Added coveralls test coverage. Updated readme. Moved testing code outside module into separate file.