Added support for Travis CI
Serialize return code correctly in binary form, minor cleanup