Move template related functions into template.php
Add hq_textomain() for templates
Improve comments