From http://0xcc.net/jsescape/ - adapted for use as a CommonJS module.
Original Copyright (c) 2007 Satoru Takabayashi <satoru 0xcc.net>
Adaptation Copyright (c) 2012 Pieter Raubenheimer email@example.com
All rights reserved. This is free software with ABSOLUTELY NO WARRANTY. You can redistribute it and/or modify it under the terms of the GNU General Public License version 2.