Test and flake fixes
Get rid of training module
Add copyright headers
More fixes