Implement commit for shared functions. In the process rehash the isAvailable / isAvailableFromCtx family.

This is fairly easy at the moment due to restrictions on direct mention of locations from contexts that are committed to a different function; see comments in Selective.cpp for more.