### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

Currently the VTL template for `request_templates` is not processed properly:

```
#set( $body = $input.json("$") )

#macro( loop $map )
{
    #foreach($key in $map.keySet())
        #set( $k = $util.escapeJavaScript($key) )
        #set( $v = $util.escapeJavaScript($map.get($key)).replaceAll("\\'", "'") )
        "$k": "$v"
        #if( $foreach.hasNext ) , #end
    #end
}
#end

{
    "enhancedAuthContext": #loop($context.authorizer),

    "headers": #loop($input.params().header),

    "query": #loop($input.params().querystring),

    "path": #loop($input.params().path),

    "identity": #loop($context.identity),

    "stageVariables": #loop($stageVariables),
}
EOF
}
```

results in,

```
'

{
    "enhancedAuthContext": {
    }
,

    "headers": {
    }
,

    "query": {
    }
,

    "path": {
    }
,

    "identity": {
    }
,

    "stageVariables": {
    }
,
}
'
```

### Expected Behavior

The template should be rendered and have the JSON properties.

### How are you starting LocalStack?

Custom (please describe below)

### Steps To Reproduce

#### How are you starting localstack (e.g., `bin/localstack` command, arguments, or `docker-compose.yml`)

    docker run localstack/localstack

#### Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

    awslocal s3 mb s3://mybucket


### Environment

```markdown
- OS: MacOS
- LocalStack: 0.14
```


### Anything else?

This example can be used to validate.
https://github.com/localstack/localstack-terraform-samples/tree/master/apigateway-lambda-velocity
template = "#set($list = $input.path('$.records')) $list.size()"
        context = {"records": [{"data": {"foo": "bar1"}}, {"data": {"foo": "bar2"}}]}
        result = render_velocity_template(template, context)
        assert result == " 2"
        result = render_velocity_template(template, json.dumps(context))
        assert result == " 2"
    def test_message_transformation(self):
        template = APIGW_TEMPLATE_TRANSFORM_KINESIS
        records = [
            {"data": {"foo": "foo1", "bar": "bar2"}},
            {"data": {"foo": "foo1", "bar": "bar2"}, "partitionKey": "key123"},
        ]
        context = {"records": records}
        def do_test(context):
            result = render_velocity_template(template, context, as_json=True)
            result_decoded = json.loads(to_str(base64.b64decode(result["Records"][0]["Data"])))
            assert result_decoded == records[0]["data"]
            assert result["Records"][0]["PartitionKey"] == "$elem.partitionKey"
            assert result["Records"][1]["PartitionKey"] == "key123"
        
        do_test(context)
        
        do_test(json.dumps(context))
        
        records = []
        context = {"records": records}
        
        result = render_velocity_template(template, context, as_json=True)
        assert result["Records"] == []
    def test_array_in_set_expr(self):