Almost done with the refactoring. Also improved README.md with a better API.
Now builds.