Refactored

Moved some of the code in (-main) into functions.
I’m aware how bad this code is, but this is my first foray into
programming with Clojure. I’m not a very experienced programmer at all.
:)