Changed the backend_ref_t struct into a Backend class. Replaced static arrays with lists. Altered functions to make the code compile. Further refactoring is needed, a part of the functions should be moved into this new class.