web_ui: remove unused imports and a commented out statement
web_ui: tolerate deleted tickets better

Implement a better algorithm for detecting when tickets don't have
ranks.  Also, don't use the ticket_id as the rank as it may already be
in use via rearranging the backlog.  Instead, choose MAX(rank)+1 as the
new rank.  Make the same change in ticket_created(), since it can suffer
from the same problem.
web_ui: implement ticket_deleted

We'll now properly remove tickets from the rank table as they're
deleted.
web_ui: detect when there are ranks without tickets and clean them up
Update the CHANGELOG