Clean up

Moved loading stuff from mod file to reference files.