Refactor rank helping functions

The render perk form functions can be used by plugins for super easy
support for configuration and permission perks.