Added dimension validation to StateSpace along with some tests
Added comments