Lots more AuthCore tests + bug fixes the tests revealed

The authcore unit tests now perform basic login/logout and verify that
access to a protected resource is allowed and denied appropraitely.
(fixed a bug related to thi also, see in-code comments in AppCmp)

Also lots of other misc tweaks/improvements...