Add to .gitignore
Cleanup to satisfy hlint and -Wall
Use StateT for simpler state management
Remove ambiguous fromInteger casts
Rewrite some explicit recursion with a loop from monad-loops

Also added a Functor constraint - can't wait for the AMP proposal to come
through...