Support to set invoice_id and credit_memo_id

The PR is to improve `Line` model to associate with multiple invoices and credit memos. Similar to the original implantation of `#invoice_id=`, I added `#credit_memo_id=`. In addition, the code is refactored to accept single id or multiple ids.