Useful functions for a rival system.

Yes, it's possible to do these things in Lua using existing functions, but they would be really brute force and would expand the memory footprint of a profile if done.

If this conflicts with my other pull request that adds functions to Profile, I'll resubmit after that one is merged.