moving the proxy into its own module; and added eventemitter to it