Added support for second signiture of .on and fixed bugs relating to

strings of multiple events and streamlined code a bit.