Friendly ActiveRecord error handling for db-enforced unique constraints

note: mysql2 adapter compatibility requires https://github.com/jordan-brough/mysql2/commit/6080e15
Rails 3.1+ puts the mysql2 adapter back in rails (where it belongs!) so this will no longer be necessary.
unicode patch for Rails escape_javascript

use actual javascript unicode escapes.
tested in osx safari 5/ff3.6/chrome9 and winxp ie7/ie8
per info on:
https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Core_Language_Features#Unicode
and looking at:
http://code.google.com/apis/opensocial/docs/0.8/reference/gadgets/#gadgets.util.escapeString
lower template logging to debug
[bugid:18984] remove yaml-ization in Active Resource