Context creation function is now supplied externally.