Actually implement the low-level stuff so that it works when we don't have all of Python available.