AUI-1104 UndoRedo should handle async actions.

This is extening the UndoRedo module to allow for async undo/redo actions. This is done by checking if these actions return promises, and making sure that any subsequent actions will wait for pending async actions before running.
Since we now have a different concept for 'actions', I've renamed the objects sent to the 'add' function by the user to 'states' instead.