First steps in refactoring

Making an Ion package out of it, dividing the executable and the code.