Bug fixes and cleanup. Need unit tests, clean up clutter, better documentation before stable.