Add functions

This patch adds the following functions:

* `dict`: creates a map from a list of pairs. facilitates passing data to subtemplates.
* `sha1`: creates a sha1 hex string from another string
* `json`: returns the JSON string representation of an object (cf. `docker inspect`)
* `last`: returns the last element of an array or slice or the last character in a string