tested for wp4

Includes sweet code cleanup by https://github.com/borkweb and inline docs by https://github.com/daveross .


git-svn-id: https://plugins.svn.wordpress.org/wp-ticket-framework/trunk@980878 b8457f37-d9ea-0310-8a92-e5e31aec5664