Move code from the validate script to the trainer script

The validate script was removed. Unit tests were updated. Removed
redundant dependency list from the main README.