fixed bug caused by refactoring
added unit tests and travis support, updated readme, fixed a bug