Simplified cleanup with lambda functions
Added unit tests
Added Travis CI, upper version