Encapsulate client code with closure and move to external file, closes #24