Refactor prefix method to take prefix as an arg

This method can be reused for moving a module up and down a page as
well as removing it, so make it more generic.

Return a dictionary rather than a string. This dict includes the
prefix that we were using previously as well as the integer index
of the field we want to operate on, which we'll need to move
modules around.