added unit tests. Disabled doc tests for ghc 7.4