BaseController::returnJson & devMode interference
I had the same problem. See Brad's response here to so this without messing with devMode: Console script tags garbling up non-html output (e.g. json) when in devMode

It would be nice if this happened automatically when specifically outputting non-html, though.