Implement some useful functions for layers, to prevent code duplication.
Merge branch 'master' of https://github.com/KevinW1998/PlatGEnWohl.git