Add callback to form handler and a dispatcher

Signed-off-by: Gawain Lynch <gawain.lynch@gmail.com>