Some bug fixes, cleanup and improved README.