Show bag number when displaying bag contents
Fix formspec injection issues
Preserve player's search string

Keep the current inventory search string when performing inventory
form actions other than searching.  This means the player's input is
not lost if the player breaks off from entering it to switch pages,
or if the player absent-mindedly ends text input with <return>.
Tweak display of searching status

When the current search produces no results, give a specific message
rather than "Page 1 of 0".  Don't display the "Filter:" label if no
filtering is currently applied.
Only do paperflip sound when really changing page
Don't overwrite registered crafts

The crafts_table was being initialised to contain only core-registered
crafts, but this would overwrite any non-core craft types that had
already been registered via unified_inventory.register_craft().  This was
especially likely because the crafts_table initialisation runs on a delay,
following all normal initialisation.  Instead, feed the core-registered
crafts into unified_inventory.register_craft().
Show non-identity digging results in craft guide
Use appropriate grid shape for each craft type

New system of registration of craft types, recording for each a display
description and the appropriate grid shape.  Recipes of a registered type
are shown in the correct grid.  Recipes of unregistered craft types are
still displayed as before, using the default 3x3 grid.
Cleaner display of lack of recipes

When the current craft guide item has no recipes, show the item and a
"No recipes" message, but suppress all other recipe UI elements.
Support item-dependent refill behaviour

The refill slot was only putting as many items as possible in a
stack, which does nothing for tools.  Tools could benefit from repair,
recharging, or other behaviour depending on the type of tool.  Change the
default refill behaviour to repair mechanical wear as well as fully
stacking.  Because other kinds of refill will require knowledge of the
metadata format, they can't be directly handled here.  So add an on_refill
hook, that tool definitions can supply to plug in appropriate behaviour.