Re-factor to add some hopefully useful APIs
Prepare for release