frameworks refactoring: add support for 'patching', separated Client from Server events, improved testing