Refactored userlib+ logusage. Merged with server.js