Added MainContext, MainLoop and related methods to ulib