Refactor intercal into a subpackage

Each functional task in the pipeline gets its own module now to make it
easier to see what private functions belong to what task.