Commented and refactored.

- Renamed some functions to homogenize classes
- Added return types to initializing functions
- In the config, closeFile is in finally block