getStates function

Get the states at nodes or tips from a mapped tree