Replacement for #3940
Guard - Add method 'id' for retrieve the current user id
Clean up some code.
Fix conflicts.