Merge pull request #568 from bhariharan/sobject_sdk

First round of metadata tests and some bug fixes