added inner constructor to Basis, added testing for state.jl