Bug Fix & PSR2

Fix #4 resource type may not be shown
Large implementation change:  no longer storing objects in the log, but
rather an abstraction.    deep cloning objects was too problematic
implemented PSR2 coding standard (as much as can be while maintaining
PHP4 support)