allow priorities for action preProcessors and postProcessors

Adds functions api.actions.addPreProcessor(func, priority) and api.actions.addPostProcessor(func, priority) that can be used instead of pushing directly onto each array, but still allows doing so, allowing any existing code to continue working as-is.