Cleaned up the mainloop interface, added blocking execute and a schedule with callbacks, both with template result handling