Add tests, other fixes
Add tap tests, fix a lot of things.