Clean up and migration to C++11 constructs