Refactoring. Moved out the file handling to moonville.py