[SYNCOPE-438] Reworking a bit the provided patch and completing implementation for console

git-svn-id: https://svn.apache.org/repos/asf/syncope/trunk@1545682 13f79535-47bb-0310-9956-ffa450edef68