cleaned things up, added basic haddocks

I took a light touch. If this is a serious library, consider looking into [Repa](https://hackage.haskell.org/package/repa) and the like.