Improved tests. Cleaned up event emitters.