Patches pushed as abd2aed92681594251f11cf65db813767c9552af and following with a few modifications (added copyright line, changed 'inputs' fields to use the new style). Thanks.