Code cleanup

First cleanup of code.
Cleaned the headers files, variable names and some style in implementation.