emit should now be callable from within a slot.

Some style fixes too.