Reorganized files/folders and fixed issues.

Reorganized files/folders as well as fixed compilation issues.