Added support for undo bar in any Window

This was made for the purpose of supporting Dialogs (which are often
in their own Window, separate from an Activity), but it should work
for any given situation.

Should solve #7.