Refactored lib, ref folders outside of js directory. Added ref folder.