Initial cleanup and conversion to C++11
Removed windows support for now.
Added optimization level for Linux.