DDF-462 added first cut at cas auth handler and refactored some code