WIP: rewrite of record waste function

We're going to need a new "stock item" field type.
Remove obsolete abvstr function
Fix up ORM session handling

We can't do the session handling in the handle_keyboard_input method
because it may be called recursively.  Do it in the keyboard driver
instead, and note that other sources of events (eg. a network socket)
will have to manage it too if they call any code that makes use of the
database.
Fix typo in flushdb help
Rollback database session on exception
Move StockType-related functions to a new module

The "stock" module was getting unwieldy and arguably they shouldn't have
been there in the first place.