revise structure of templates

Change-Id: I1a88359c0394a90d222ea28e652df47b97854bf1
Reviewed-on: http://review.couchbase.org/27964
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Pavel Paulau <pavel.paulau@gmail.com>