some DRY, some refactoring, bug-fixing, UI improvements

now works on wordpress 4 multisite