Rewrite ticket list getting to support limit and startkey
tidy sockethandler
Add ticket pagination support