Fix up promises and some clutter in the api.
Clean up debug logging
Add first 9 tests.
0.2.2