massive refactoring to be closer to how st2 works
merged