Restructure library to include modules