Singleton DB and minor bug fix

Changed the database connection to object oriented singleton model. Also
fixed a bug where customers could order items that were not in stock.
These items are still in the system, but if a customer tries to add them
into cart he gets a message informing him they are out of stock.