revamp much of the code to use pretty event emitters instead of ugly force-fed parameters