Implement Initial Tests

This is an initial pass at starting to implement a StreamMachine test suite.  It's not testing much yet, but it works and it seems better to go ahead and get it into master now so that new development can include tests.