Add cabal packaging.
Fix warnings due to using PatternGuards undeclared.