Template layers v2

Some updates to layers and a couple of fixes to the package manager.