Separate out libcgroup based functionality and add configurable templates.