Modified for build with Travis, and code cleaning.