Fix serialization bug
1) Move getModule back to MainProgram
2) Make modules and settings serializable