Added an options parameter to the :to_json serialization method that rails rending requires.

Redid fork and pull request to clean up commit history.  I squashed it too late the first time.