unit tests and bunch of bug fixes for Haskell parser