Current progress with authentication. This breaks if authentication fails
Fix authentication so it works without using non-portable APIs. Renamed ContextRunnable to SecurityHandler - hopefully this is a better name for it