Refactor nodes into a separate module, code cleanup after prototype

Significantly reduces filesize and complexity of core.clj.