refactored server side : most js files are moved into the libs directory