Added main file functionality only for autosave mode, the code should be checked and revised if neccessary
Path joining is updated

However, it should be tested now.
Merge pull request #28 from Playm/mainfile_functionality

Mainfile functionality from Playm