rest-gen: Refactor Haskell code generation to be based on haskell-src-ex...

...ts