Restructured functions file to load individual libs files.