various changes to API, reademe, and added many unit tests.
further merge