modify how flags "expire"
fix rare issue with alias (maybe) update some tests
moved some classes around