Fixes of IDEAS-21& IDEAS-23

http://jira.xwiki.org/browse/IDEAS-21?jql=project%20%3D%20IDEAS%20AND%20resolution%20%3D%20Unresolved%20AND%20priority%20%3D%20Major%20ORDER%20BY%20key%20DESC

http://jira.xwiki.org/browse/IDEAS-23?jql=project%20%3D%20IDEAS%20AND%20resolution%20%3D%20Unresolved%20AND%20priority%20%3D%20Major%20ORDER%20BY%20key%20DESC

And another issue is that we shouldn't store unprefixed document references, but fully serialized ones in the form `wiki:XWiki.uname`. `getLocalUser` should be deprecated.