Added more comments and assertions to all classes; clean up
Updated readme
Add javascript function