Replaced hook_element_info by annotated classes. See change record #2320115

Do we need to also move this into class?