Added MIT license.
Cleaned up Cabal file.
Added docs/comments.
Renamed Types module to RegisterState for sensibleness.