json refactoring
Merge pull request #1522 from WalterBright/b21

json refactoring
Fixes Issue 2452 - Better diagnostic on unimplemented interface.