Cleaned up some math stuff. Straightened out some general purpose timer stuff.