Added ticket functionality.

Not finished.