huge commit solving all pre-existing problems

there’s still a lot to be done, but here’s leaps and bounds in the
right direction, sorry for the delay @samdeanefox