0.1: Tons of refactoring/cleanup

Made the whole thing a little cleaner and put in the first steps to the
goal API.