Finished ruler system

Coding for rulers should be done for now. I also added an average
function macro to math.h. At this time, I am unsure if the code will
compile. I will fix any compilation problems.

@danielgrimshaw what is the practicality of replacing timer system
functions with macros? I marked the section in timer.c with a comment.
If it's fine, we'll test them all before implementing the same change in
the ruler system.