Code cleanup for the trainer script

Removed the --db options, as these can be discovered via the image
directory. Also included unit tests for the trainer script. Added
a .travis.yml file. And made some small documentation updates.