New libcork allocation API

We're not supposed to use `free` anymore, since libcork now allows the end application to provide a custom memory allocator.  The new API also allows libraries that use libcork to accept their own custom allocator, different than the one that libcork itself uses.  But we're not taking advantage of that capability at present.
I had to factor this out to make the cmake detection logic work.  The cmake script compiles a file at configure time, when it's not as easy to set up all of the search paths for libcork.  The new libcork allocator stuff includes a lot of `static` functions that weren't compiling correctly during the configure step.  So now I've factored out the "choose which context implementation to use" into a separate file, which doesn't need to bring in `libcork/core.h`.  That made everything compile nicely without having to do major surgery to the cmake scripts.