Got the rake task working, and fixed the model associations a bit