Group ring imports together.
Use as-entities.
Remove unused code.
Use defined attributes instead of repeating inline.
Fix as-entities being undefined on usage.

I don't quite understand the design rationale of this behavior, probably
to simplify the reader? Still it seems very non-dynamic to me,
especially given the usual workflow of adding new vars in a repl,
piecing things together (from namespaces and repl) and then quite a bit
later on restarting the application noticing the order is wrong.

Especially for reading files top-bottom, this is inconvenient, because
you can't actually write files like that (high-level on top) without
having a giant `declare` at the top of the file.