New tracking system

You can now lock with a double-click on anything, food included. This
also fixes a few bugs and subtly changes the way clicking and
double-clicking works.