Move application code into modules