Allow closures in systemlib.php

Allow closures to be used in systemlib.php. This is needed for #2322.