Allow local JSON podspec files to be used

A few tweaks to allow local `.podspec.json` podspec files to be used (Issue #1485). I haven't written extra tests for the changes yet, but I wanted to see if I was going along the right lines with my implementation. Specs pass with the changes, and manual testing loads in a JSON podspec successfully.

This is my first open source pull request, so please let me know if I've done something wrong!