Final tweaks to module structure and set up for Haskell wrappers.