lots of cleanup and bug fixes, getting very close to a first release