Initial code review

@evanstade Please review.  Hopefully the pull request flow will let you add comments.
all Magento globals