Refactored Serializable and GenericDeviceAccessPermission. Fixed EventManager (not tests though: just removed test annotation to ignore). Fixed dist by upgrading libs.