Mildly refactored code, with tests and travis-ci

Uses strict