Submachine as a class meant to be extended

Change the DSL to a subclass-and-extend paradigm, making it possible to implement classes extending Submachine functionality and to create multiple instances of the same state machine class.