Make relativeFrequency.py usable

I modified some functions, added others, included slightly more documentation and commenting, and generally cleaned things up.