Factored the common behaviors into an abstract delegate map class.
Added some more test cases.