Add support for kerberos ticket enumeration

Fix up a bunch of other issues and do some code tidies too.