refactoring to allow startup and cleanup actions

We'll use this initially to build the EasySandbox shared library
that will be used to sandbox C/C++ submissions.