Add unit tests for reordering/removing handlers; misc tweaks.