Merge pull request #3 from colinmollenhour/master

Fix PHP Recoverable Error in cron job. Move database code to resource mo...
Fix undefined method error.