add priorites for preprocess and postprocess middleware

Add functions actions.addPreProcessor(func, priority) and actions.addPostProcessor(func, priority) that allow middleware to be called in a specified order.  Leaves the old array.push method intact so no existing code needs to be modified.

Add tests for new functions.