DDF-641: Updated CAS client to work with new security arch.
Also cleaned up some code style issues.