Use module pattern to prevent global scope pollution
Use object literals for dictionaries
Use template for javascript catalog

The same template is used for the `javascript_catalog` and
`null_javascript_catalog` views; they're simply supplied with different
context variables. In addition, the catalog dictionary is defined using
an object literal (serialized using simplejson), which eliminates a few
bytes when compared to the original method.
End function definitions with semicolons
Serialize formats dict with simplejson

Also, include all keys in object definition instead of using repeated
assignment.
A little PEP8ing