First pass at typing methods

I also introduced an interface for flags (yay).