Server: move User to a dedicated module
Minor refactoring
Fix coding style
Fix indent