Exporting templates

Work in progress