Solve problems when exposing global. Fix also problems when extending templates

`fieldTemplate` is a function and when replaced outside of local scope, its reference is changed not allowing me to extend template behavior.

```
// Local scope
global.JSONForm.fieldTemplate = jsonform.fieldTemplate;

// Global scope
JSONForm.fieldTemplate = function() {};
```