Fixes PHP5.4 Issues and improves debug logs

Array literals have been replaced to maximize backwards compatibility and fix #38
The API credentials encryption and serialization process introduced a few bugs. @ionux
did most of the heavy work of rooting out the problems and providing fixes that
also include a fix for #39.
Merge pull request #40 from sambohler/master

Fixes PHP5.4 Issues and improves debug logs