Fix seg-faults

* Re-wrote line parsing to handle missing values
* Purchases used to store pointers to customer and products. These got moved when the customer and product arrays were `realloc`ed. I changed it to just make copies.
* A little bit of other misc. cleanup.