refactor StateBase into more flexible StateMatrix
StateTuple, allows state of various types
consistent naming of StateMatrix and StateTuple
pf test both row and col major state matrix/tuple
add doc