Moving methods

Pulled some logic into State, rather than repeating that logic all over
the place. Also, added bin and obj to ignore directories.