removed all non-commonjs related code and added an emmiterify function to conveniently extend objects.