Introduce template layers, couple of bugfixes

Start on ACP