Fixed circular import errors.

These didn't show up when testing in iPython. Anyway, by 'fixed' I mean I
hacked it. Everyone says these point to bad code organization and I now see
that they're right, but I hate that monolithic file I had before.

I need to rework it. There's a distinction here that I'm missing.