Reorganizing the files

Completely reorganized the file structure. Now each folder represents
one function of the project.