This adds initial support for on-demand inputs by allowing new inputs to be created with only a shared reference to the database. This allows creating new inputs during a revision and therefore from inside tracked functions.