Code cleanup and small CPU code optimizations - also removed some benchmark code and unnecessary variables.