Story #21: invoicing

This is not complete, but has enough of the base infrastructure working (resque etc) that it could be merged onto master to allow others to start using it. We will keep working on this branch though, so it won't be removed after merge.