Merge pull request #1 from bitpay/master

Sync with BitPay repo
Added error msgs when core funcs not available

Also added default case in the event an unhandled IPN status is sent
Fixed invoice error handling & code cleanup

Fixed deprecated uses of the old PHP4-style var keyword
Merge pull request #19 from ionux/master

Fixed invoice error handling