Support for pre and post run tasks and cleaned up some errors

Cool stuff