cleaned up code and states

added all states, node and fold, to a states package. also updated the
node class to reflect all changes. implemented brian's most recent fold
state updates as well. in general, also cleaned up a lot of code