Refactored invoice route. Handling pay view for paid invoices

 * Extracted invoice/payment related functions to invoiceutil
 * Pay and invoice routes now call invoiceutil
 * Now handling pay view when invoice is paid in full