Move the axis logic into a seprate module, closes #26, contributes to #28.