Adding the appdirs module.

This module is MIT licensed.
Creating and saving trainers now works.

For the time being, trainers are autosaved when a state is destroyed.