current_user/1: Refactor to perform caching in Java

Instead of implementing all of the caching logic in Prolog, do
it in Java. Its slightly shorter this way, and faster at runtime.

Also support user(anonymous).

Change-Id: Icfb588329cc61b6470deb3128f8a7f86621a4099
3 files changed