added comments, cleaned up source / api
lots of cleanup, commenting, misc. reorg