refactor...bug fixes...testing formatted for sanity...global event system and registration done