rearranged module hierarchy

Also fixed haddock and cabal files