Restructuring to use and compile using lib/.