Merge pull request #60 from tonyhuang/master

Add in errorcode.
Fix failing test
More robust upgrade which will convert even if old phoenix jar is in place on server
Bug fixes for automatic upgrade
Merge branch 'master' into stat