template_service.js Constant Declarations

Moved constant declarations above first function. First function used
one of the constants before it was declared. Fixed several Comparison
Operators throughout.