Using guava cache builder to create template cache. Also ensured
compilation mutex is released even in the case of the exceptions.

Fixes #5 and fixes #13.