fixed tests, cleaned up some basis.jl code, flipped ket and bra parameters