More work on module structure

1. Restructured and added settings for new module structure.
2. Restructured functions files to be split up by module.