Refactor: Switched materialarchive.c to C++