Made it a proper library, and fixed some stuff

I made it a proper library (aka added the cabal stuff needed to make it easily installable by other haskellers). I also added haddock documentation, based on the README. I also fixed some type-errors in the code, and fixed some errors in examples. I've also run hlint on it and made the code a bit cleaner. I also added a AUTHOR file.