Framerate controls

-framerate cap implemented
-framerate monitor implemented
-misc. code tidying