massive logic package cleanup effort: complete

my god that thing was a mess. I've changed all kinds of stuff, got rid
of unecessary and dangerous looking junk, fixed as much as possible up
to be decent scala code.

i also renamed the package and moved some stuff that was in trc1 into
it. anyway, I feel much better about it. still some stuff I want to try,
though.