Switch to EventEmitter, simplify API a little.