Add support for out of band invoice creation

Also includes support for manually updating (i.e. closing / reopening)
invoices.