switch to using boost::chrono to be cross platform
refactor and slight optimizations
more refactoring, add some places for timing