Added test suite to Cabal

Fixed some warnings in the test suite and integrated it directly into
Cabal.  To use, type:
cabal configure --enable-tests
cabal build
cabal test