Index: Dev/trunk/Gruntfile.js
===================================================================
--- Dev/trunk/Gruntfile.js	(revision 486)
+++ Dev/trunk/Gruntfile.js	(revision 487)
@@ -13,4 +13,5 @@
                                   ,'htmlhint:lint'
                                   ,'coffeelint:lint'
+                                  //,'tv4:lint'
                                   ,'less:compile'
                                   ,'usebanner:generated-css'
@@ -20,5 +21,6 @@
                                 //,'amd-check' // too smart about plugins, r.js can't find them
                                   ]);
-    grunt.registerTask('build', ['clean:build'
+    grunt.registerTask('build', ['compile'
+                                ,'clean:build'
                                 ,'copy:build'
                                 ,'dojo:build'
@@ -107,4 +109,13 @@
             }
         },
+        tv4: {
+            lint: {
+                options: {
+                    root: grunt.file.readJSON('json-schema-draft-04.json'),
+                    multi: true
+                },
+                src: [srcDir+'server/config/couchdb-schema.json']
+            }
+        },
         usebanner: {
             'generated-css': { options: { position: 'top',
@@ -129,4 +140,5 @@
     grunt.loadNpmTasks('grunt-dojo');
     grunt.loadNpmTasks('grunt-htmlhint');
+    grunt.loadNpmTasks('grunt-tv4');
     grunt.loadTasks('./grunt-tasks');
 
Index: Dev/trunk/json-schema-draft-04.json
===================================================================
--- Dev/trunk/json-schema-draft-04.json	(revision 487)
+++ Dev/trunk/json-schema-draft-04.json	(revision 487)
@@ -0,0 +1,150 @@
+{
+    "id": "http://json-schema.org/draft-04/schema#",
+    "$schema": "http://json-schema.org/draft-04/schema#",
+    "description": "Core schema meta-schema",
+    "definitions": {
+        "schemaArray": {
+            "type": "array",
+            "minItems": 1,
+            "items": { "$ref": "#" }
+        },
+        "positiveInteger": {
+            "type": "integer",
+            "minimum": 0
+        },
+        "positiveIntegerDefault0": {
+            "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
+        },
+        "simpleTypes": {
+            "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
+        },
+        "stringArray": {
+            "type": "array",
+            "items": { "type": "string" },
+            "minItems": 1,
+            "uniqueItems": true
+        }
+    },
+    "type": "object",
+    "properties": {
+        "id": {
+            "type": "string",
+            "format": "uri"
+        },
+        "$schema": {
+            "type": "string",
+            "format": "uri"
+        },
+        "title": {
+            "type": "string"
+        },
+        "description": {
+            "type": "string"
+        },
+        "default": {},
+        "multipleOf": {
+            "type": "number",
+            "minimum": 0,
+            "exclusiveMinimum": true
+        },
+        "maximum": {
+            "type": "number"
+        },
+        "exclusiveMaximum": {
+            "type": "boolean",
+            "default": false
+        },
+        "minimum": {
+            "type": "number"
+        },
+        "exclusiveMinimum": {
+            "type": "boolean",
+            "default": false
+        },
+        "maxLength": { "$ref": "#/definitions/positiveInteger" },
+        "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
+        "pattern": {
+            "type": "string",
+            "format": "regex"
+        },
+        "additionalItems": {
+            "anyOf": [
+                { "type": "boolean" },
+                { "$ref": "#" }
+            ],
+            "default": {}
+        },
+        "items": {
+            "anyOf": [
+                { "$ref": "#" },
+                { "$ref": "#/definitions/schemaArray" }
+            ],
+            "default": {}
+        },
+        "maxItems": { "$ref": "#/definitions/positiveInteger" },
+        "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
+        "uniqueItems": {
+            "type": "boolean",
+            "default": false
+        },
+        "maxProperties": { "$ref": "#/definitions/positiveInteger" },
+        "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
+        "required": { "$ref": "#/definitions/stringArray" },
+        "additionalProperties": {
+            "anyOf": [
+                { "type": "boolean" },
+                { "$ref": "#" }
+            ],
+            "default": {}
+        },
+        "definitions": {
+            "type": "object",
+            "additionalProperties": { "$ref": "#" },
+            "default": {}
+        },
+        "properties": {
+            "type": "object",
+            "additionalProperties": { "$ref": "#" },
+            "default": {}
+        },
+        "patternProperties": {
+            "type": "object",
+            "additionalProperties": { "$ref": "#" },
+            "default": {}
+        },
+        "dependencies": {
+            "type": "object",
+            "additionalProperties": {
+                "anyOf": [
+                    { "$ref": "#" },
+                    { "$ref": "#/definitions/stringArray" }
+                ]
+            }
+        },
+        "enum": {
+            "type": "array",
+            "minItems": 1,
+            "uniqueItems": true
+        },
+        "type": {
+            "anyOf": [
+                { "$ref": "#/definitions/simpleTypes" },
+                {
+                    "type": "array",
+                    "items": { "$ref": "#/definitions/simpleTypes" },
+                    "minItems": 1,
+                    "uniqueItems": true
+                }
+            ]
+        },
+        "allOf": { "$ref": "#/definitions/schemaArray" },
+        "anyOf": { "$ref": "#/definitions/schemaArray" },
+        "oneOf": { "$ref": "#/definitions/schemaArray" },
+        "not": { "$ref": "#" }
+    },
+    "dependencies": {
+        "exclusiveMaximum": [ "maximum" ],
+        "exclusiveMinimum": [ "minimum" ]
+    },
+    "default": {}
+}
Index: Dev/trunk/node_modules/grunt-tv4/LICENSE-MIT
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/LICENSE-MIT	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/LICENSE-MIT	(revision 487)
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Bart van der Schoor
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/README.md	(revision 487)
@@ -0,0 +1,189 @@
+# grunt-tv4
+
+[![Build Status](https://secure.travis-ci.org/Bartvds/grunt-tv4.png?branch=master)](http://travis-ci.org/Bartvds/grunt-tv4) [![Dependency Status](https://gemnasium.com/Bartvds/grunt-tv4.png)](https://gemnasium.com/Bartvds/grunt-tv4) [![NPM version](https://badge.fury.io/js/grunt-tv4.png)](http://badge.fury.io/js/grunt-tv4)
+
+> Use grunt and [Tiny Validator tv4](https://github.com/geraintluff/tv4) to validate values against [json-schema](http://json-schema.org/) draft v4
+
+## Getting Started
+
+This plugin requires Grunt `~0.4.1`
+
+If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
+
+```shell
+$ npm install grunt-tv4 --save-dev
+```
+
+Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
+
+```js
+grunt.loadNpmTasks('grunt-tv4');
+```
+
+## The "tv4" task
+
+### Notes
+
+* Uses [Tiny Validator tv4 ](https://github.com/geraintluff/tv4) so schemas must conform to [json-schema draft v4](http://json-schema.org/documentation.html).
+* Supports automatically resolution and loading remote references by http via `$ref`. 
+* To use `$ref` see the [json-schema](http://json-schema.org/) documentation or [this help](http://spacetelescope.github.io/understanding-json-schema/structuring.html). 
+* For general help with json-schema see this excelent [guide](http://spacetelescope.github.io/understanding-json-schema/) and usable [reference](http://spacetelescope.github.io/understanding-json-schema/reference/index.html).
+* Errors formatted by the [tv4-reporter](https://github.com/Bartvds/tv4-reporter) library.
+
+### API change 
+
+As of version `v0.2.0` the API was changed to follow the Grunt options- and file-selection conventions. The old pattern (which abused the destination-specifier) is no longer supported. The readme for the previous API can be found [here](https://github.com/Bartvds/grunt-tv4/tree/71ef1726945d05efd5daca29f26cbf4ab09c858e).
+
+The root schema must now to be specified as `options.root`.
+
+### Example
+
+* Demo of version `v0.3.0` output on [travis-ci](https://travis-ci.org/Bartvds/grunt-tv4/jobs/14468920)
+
+### Basic usage
+
+Validate from .json files:
+
+```js
+grunt.initConfig({
+	tv4: {
+		options: {
+		    root: grunt.file.readJSON('schema/main.json')
+		}
+		myTarget: {
+			src: ['data/*.json']
+		}
+	}
+})
+```
+
+Valdiate values:
+
+```js
+grunt.initConfig({
+	tv4: {
+		myTarget: {
+			options: {
+				root: {
+					type: 'object',
+					properties: { ... }
+				}
+			},
+			values: [
+				{ ... },
+				{ ... }
+			]
+		}
+	}
+})
+````
+
+### Advanced usage
+
+```js
+grunt.initConfig({
+	tv4: {
+		options: {
+			// specify the main schema, one of:
+            // - path to json
+            // - http-url
+            // - schema object
+            // - callback that returns one of the above
+			root: grunt.file.readJSON('schema/main.json'),
+
+			// show multiple errors per file (off by default)
+			multi: true,
+
+			// create a new tv4 instance for every target (off by default)
+			fresh: true,
+
+			// add schemas in bulk (each required to have an 'id' property) (can be a callback)
+			add: [
+				 grunt.file.readJSON('schema/apple.json'),
+				 grunt.file.readJSON('schema/pear.json')
+			],
+
+			// set schemas by URI (can be a callback)
+			schemas: {
+				'http://example.com/schema/apple': grunt.file.readJSON('schema/apple.json'),
+				'http://example.com/schema/pear': grunt.file.readJSON('schema/pear.json')
+			},
+
+			// map of custom formats passed to tv4.addFormat()
+			formats: {
+				date: function (data, schema) {
+					if (typeof data !== 'string' || !dateRegex.test(data)) {
+						return 'value must be string of the form: YYYY-MM-DD';
+					}
+					return null;
+				}
+			},
+
+			// passed to tv4.validate()
+			checkRecursive: false
+			// passed to tv4.validate()
+			banUnknownProperties: false
+			// passed tv4.language()
+			language: 'de'
+			// passed tv4.addLanguage()
+			languages: {
+				'de': { ... }
+			}
+		},
+		// load json from disk
+		myFiles: {
+			src: ['data/*.json', 'data/fruit/**/*.json']
+		},
+
+		myValues: {
+			// validate values
+			values: [
+				grunt.file.readJSON('data/apple.json'),
+				grunt.file.readJSON('data/pear.json')
+			],
+		},
+
+		myValueMap: {
+			// alternately pass as object and the keys will be used as labels in the reports
+			values: {
+				'apple': grunt.file.readJSON('data/apple.json'),
+				'pear': grunt.file.readJSON('data/pear.json')
+			},
+		},
+
+		myCallback: {
+			// alternately pass a function() to return a collection of values (array or object)
+			values: function() {
+				return {
+					'apple': grunt.file.readJSON('data/apple.json'),
+					'pear': grunt.file.readJSON('data/pear.json')
+				}
+			}
+		}
+	}
+})
+```
+
+## History
+
+* 0.4.0 - Updated some depedencies. `root`, `add` and `schemas` can be a callback function (for lazy init).
+* 0.3.0 - Big internal rewrite:
+	* Added `.values` option. 
+	* Extracted reporting to [tv4-reporter](https://github.com/Bartvds/tv4-reporter), [miniwrite](https://github.com/Bartvds/miniwrite) and [ministyle](https://github.com/Bartvds/ministyle).
+	* Moved loader logic to own stand-alone module (for later extraction)
+	* Extracted test-running logic to own module (for later extraction)
+* 0.2.1 - Added support to report subErrors (for anyOf/oneOf)
+* 0.2.0 - Updated to follow the Grunt conventions.
+* 0.1.4 - Updated `tv4` to version `1.0.11` 
+  * Added support for `tv4.addFormat()` / `languages` / `checkRecursive` / `banUnknownProperties`.
+* 0.1.3 - Support for loading remote references (JSON Schema's `$ref`).
+* 0.1.1 - Bugfixes and improved reporting
+* 0.1.0 - First release with synchronous validation
+
+
+## Contributing
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
+
+
+[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Bartvds/grunt-tv4/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+
Index: Dev/trunk/node_modules/grunt-tv4/lib/loader.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/lib/loader.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/lib/loader.js	(revision 487)
@@ -0,0 +1,69 @@
+var request = require('request');
+var fs = require('fs');
+
+function loadHTTP(uri, options, callback) {
+	request.get({url: uri, timeout: options ? options.timeout : 5000}, function (err, res) {
+		if (err) {
+			return callback(err);
+		}
+		if (!res || !res.body) {
+			return callback(new Error('empty response at: ' + uri));
+		}
+		if (res.statusCode < 200 || res.statusCode >= 400) {
+			return callback(new Error('http bad response code: ' + res.statusCode + ' on ' + uri));
+		}
+		var value;
+		try {
+			value = JSON.parse(res.body);
+		}
+		catch (e) {
+			return callback(e);
+		}
+		callback(null, value);
+	});
+}
+
+function loadPath(src, options, callback) {
+	fs.readFile(src, 'utf8', function (err, str) {
+		if (err) {
+			return callback(err);
+		}
+		var value;
+		try {
+			value = JSON.parse(str);
+		}
+		catch (e) {
+			return callback(e);
+		}
+		callback(null, value);
+	});
+}
+
+function getLoaders() {
+	var scope = {};
+	scope.loadHTTP = loadHTTP;
+	scope.loadPath = loadPath;
+
+	scope.loadFile = function (uri, options, callback) {
+		scope.loadPath(uri, options, callback);
+	};
+	scope.load = function (uri, options, callback) {
+		if (/^https?:/.test(uri)) {
+			scope.loadHTTP(uri, options, callback);
+			return;
+		}
+		else if (/^file?:/.test(uri)) {
+			scope.loadFile(uri, options, callback);
+			return;
+		}
+		else {
+			scope.loadPath(uri, options, callback);
+			return;
+		}
+	};
+	return scope;
+}
+
+module.exports = {
+	getLoaders: getLoaders
+};
Index: Dev/trunk/node_modules/grunt-tv4/lib/runner.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/lib/runner.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/lib/runner.js	(revision 487)
@@ -0,0 +1,386 @@
+// Bulk validation core: composites with tv4, miniwrite, ministyle and loaders
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+function nextTick(call) {
+	//lame setImmediate shimable
+	if (typeof setImmediate === 'function') {
+		setImmediate(call);
+	}
+	else if (process && typeof process.nextTick === 'function') {
+		process.nextTick(call);
+	}
+	else {
+		setTimeout(call, 1);
+	}
+}
+
+// for-each async style
+function forAsync(items, iter, callback) {
+	var keys = Object.keys(items);
+	var step = function (err, callback) {
+		nextTick(function () {
+			if (err) {
+				return callback(err);
+			}
+			if (keys.length === 0) {
+				return callback();
+			}
+			var key = keys.pop();
+			iter(items[key], key, function (err) {
+				step(err, callback);
+			});
+		});
+	};
+	step(null, callback);
+}
+
+function copyProps(target, source, recursive) {
+	if (source) {
+		Object.keys(source).forEach(function (key) {
+			if (recursive && typeof source[key] === 'object') {
+				target[key] = copyProps((Array.isArray(source[key]) ? [] : {}), source[key], recursive);
+				return;
+			}
+			target[key] = source[key];
+		});
+	}
+	return target;
+}
+
+function sortLabel(a, b) {
+	if (a.label < b.label) {
+		return 1;
+	}
+	if (a.label > b.label) {
+		return -1;
+	}
+	// a must be equal to b
+	return 0;
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+function isURL(uri) {
+	return (/^https?:/.test(uri) || /^file:/.test(uri));
+}
+
+var headExp = /^(\w+):/;
+
+function getURLProtocol(uri) {
+	if (isURL(uri)) {
+		headExp.lastIndex = 0;
+		var res = headExp.exec(uri);
+		if ((res && res.length >= 2)) {
+			return res[1];
+		}
+	}
+	return '<unknown uri protocol>';
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+function getOptions(merge) {
+	var options = {
+		root: null,
+		schemas: {},
+		add: [],
+		formats: {},
+		fresh: false,
+		multi: false,
+		timeout: 5000,
+		checkRecursive: false,
+		banUnknown: true,
+		languages: {},
+		language: null
+	};
+	return copyProps(options, merge);
+}
+
+function getRunner(tv4, loader, out, style) {
+
+	function getContext(options) {
+		var context = {};
+		context.tv4 = (options.fresh ? tv4.freshApi() : tv4);
+		context.options = {};
+
+		//import options
+		if (options) {
+			context.options = getOptions(options);
+		}
+
+		if (typeof context.options.root === 'function') {
+			context.options.root = context.options.root();
+		}
+
+		if (typeof context.options.schemas === 'function') {
+			context.options.schemas = context.options.schemas();
+		}
+
+		if (typeof context.options.add === 'function') {
+			context.options.add = context.options.add();
+		}
+
+		// main validation method
+		context.validate = function (objects, callback) {
+			// retunr value
+			var job = {
+				context: context,
+				total: objects.length,
+				objects: objects, //TODO rename objects to values
+				success: true,
+				error: null,
+				passed: [],
+				failed: []
+			};
+
+			if (job.objects.length === 0) {
+				job.error = new Error('zero objects selected');
+				finaliseTask(job.error, job, callback);
+				return;
+			}
+			job.objects.sort(sortLabel);
+
+			//start the flow
+			loadSchemaList(job, job.context.tv4.getMissingUris(), function (err) {
+				if (err) {
+					return finaliseTask(err, job, callback);
+				}
+				// loop all objects
+				forAsync(job.objects, function (object, index, callback) {
+					validateObject(job, object, callback);
+
+				}, function (err) {
+					finaliseTask(err, job, callback);
+				});
+			});
+		};
+		return context;
+	}
+
+	var repAccent = style.accent('/');
+	var repProto = style.accent('://');
+
+	function tweakURI(str) {
+		return str.split(/:\/\//).map(function (str) {
+			return str.replace(/\//g, repAccent);
+		}).join(repProto);
+	}
+
+	function finaliseTask(err, job, callback) {
+		job.success = (job.success && !job.error && job.failed.length === 0);
+		if (job.error) {
+			out.writeln('');
+			out.writeln(style.warning('warning: ') + job.error);
+			out.writeln('');
+			callback(null, job);
+			return;
+		}
+		if (err) {
+			out.writeln('');
+			out.writeln(style.error('error: ') + err);
+			out.writeln('');
+			callback(err, job);
+			return;
+		}
+		out.writeln('');
+		callback(null, job);
+	}
+
+	//load and add batch of schema by uri, repeat until all missing are solved
+	function loadSchemaList(job, uris, callback) {
+		uris = uris.filter(function (value) {
+			return !!value;
+		});
+
+		if (uris.length === 0) {
+			nextTick(function () {
+				callback();
+			});
+			return;
+		}
+
+		var sweep = function () {
+			if (uris.length === 0) {
+				nextTick(callback);
+				return;
+			}
+			forAsync(uris, function (uri, i, callback) {
+				if (!uri) {
+					out.writeln('> ' + style.error('cannot load') + ' "' + tweakURI(uri) + '"');
+					callback();
+				}
+				out.writeln('> ' + style.accent('load') + ' + ' + tweakURI(uri));
+
+				loader.load(uri, job.context.options, function (err, schema) {
+					if (err) {
+						return callback(err);
+					}
+					job.context.tv4.addSchema(uri, schema);
+					uris = job.context.tv4.getMissingUris();
+					callback();
+				});
+			}, function (err) {
+				if (err) {
+					job.error = err;
+					return callback(null);
+				}
+				// sweep again
+				sweep();
+			});
+		};
+		sweep();
+	}
+
+	//supports automatic lazy loading
+	function recursiveTest(job, object, callback) {
+		var opts = job.context.options;
+		if (job.context.options.multi) {
+			object.result = job.context.tv4.validateMultiple(object.value, object.schema, opts.checkRecursive, opts.banUnknown);
+		}
+		else {
+			object.result = job.context.tv4.validateResult(object.value, object.schema, opts.checkRecursive, opts.banUnknown);
+		}
+
+		//TODO verify reportOnMissing
+		if (!object.result.valid) {
+			job.failed.push(object);
+			out.writeln('> ' + style.error('fail') + ' - ' + tweakURI(object.label));
+			return callback();
+		}
+		if (object.result.missing.length === 0) {
+			job.passed.push(object);
+			out.writeln('> ' + style.success('pass') + ' | ' + tweakURI(object.label));
+			return callback();
+		}
+
+		// test for bad fragment pointer fall-through
+		if (!object.result.missing.every(function (value) {
+			return (value !== '');
+		})) {
+			job.failed.push(object);
+			out.writeln('> ' + style.error('empty missing-schema url detected') + ' (this likely casued by a bad fragment pointer)');
+			return callback();
+		}
+
+		out.writeln('> ' + style.accent('auto') + ' ! validation missing ' + object.result.missing.length + ' urls:');
+		out.writeln('> "' + object.result.missing.join('"\n> "') + '"');
+
+		// auto load missing (if loading has an error  we'll bail way back)
+		loadSchemaList(job, object.result.missing, function (err) {
+			if (err) {
+				return callback(err);
+			}
+			//check again
+			recursiveTest(job, object, callback);
+		});
+	}
+
+	function startLoading(job, object, callback) {
+		//pre fetch (saves a validation round)
+		loadSchemaList(job, job.context.tv4.getMissingUris(), function (err) {
+			if (err) {
+				return callback(err);
+			}
+			recursiveTest(job, object, callback);
+		});
+	}
+
+	//validate single object
+	function validateObject(job, object, callback) {
+		if (typeof object.value === 'undefined') {
+			var onLoad = function (err, obj) {
+				if (err) {
+					job.error = err;
+					return callback(err);
+				}
+				object.value = obj;
+				doValidateObject(job, object, callback);
+			};
+			var opts = {
+				timeout: (job.context.options.timeout || 5000)
+			};
+			//TODO verify http:, file: and plain paths all load properly
+			if (object.path) {
+				loader.loadPath(object.path, opts, onLoad);
+			}
+			else if (object.url) {
+				loader.load(object.url, opts, onLoad);
+			}
+			else {
+				callback(new Error('object missing value, path or url'));
+			}
+		}
+		else {
+			doValidateObject(job, object, callback);
+		}
+	}
+
+	function doValidateObject(job, object, callback) {
+		if (!object.root) {
+			//out.writeln(style.warn('no explicit root schema'));
+			//out.writeln('');
+			//TODO handle this better
+			job.error = new Error('no explicit root schema');
+			callback(job);
+			return;
+		}
+		var t = typeof object.root;
+
+		switch (t) {
+			case 'object':
+				if (!Array.isArray(object.root)) {
+					object.schema = object.root;
+					job.context.tv4.addSchema((object.schema.id || ''), object.schema);
+
+					startLoading(job, object, callback);
+				}
+				return;
+			case 'string':
+				//known from previous sessions?
+				var schema = job.context.tv4.getSchema(object.root);
+				if (schema) {
+					out.writeln('> ' + style.plain('have') + ' : ' + tweakURI(object.root));
+					object.schema = schema;
+
+					recursiveTest(job, object, callback);
+					return;
+				}
+				out.writeln('> ' + style.accent('root') + ' > ' + tweakURI(object.root));
+
+				loader.load(object.root, job.context.options, function (err, schema) {
+					if (err) {
+						job.error = err;
+						return callback(job.error);
+					}
+					if (!schema) {
+						job.error = new Error('no schema loaded from: ' + object.root);
+						return callback(job.error);
+					}
+
+					object.schema = schema;
+					job.context.tv4.addSchema(object.root, schema);
+
+					if (object.schema.id) {
+						job.context.tv4.addSchema(object.schema);
+					}
+					startLoading(job, object, callback);
+				});
+				return;
+			default:
+				callback(new Error('don\'t know how to load: ' + object.root));
+				return;
+		}
+	}
+
+	return {
+		isURL: isURL,
+		getURLProtocol: getURLProtocol,
+		getOptions: getOptions,
+		getContext: getContext
+	};
+}
+
+module.exports = {
+	getRunner: getRunner
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/.name
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/.name	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/.name	(revision 487)
@@ -0,0 +1,1 @@
+jsonpointer.js
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/codeStyleSettings.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/codeStyleSettings.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/codeStyleSettings.xml	(revision 487)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectCodeStyleSettingsManager">
+    <option name="PER_PROJECT_SETTINGS">
+      <value>
+        <XML>
+          <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
+        </XML>
+      </value>
+    </option>
+  </component>
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/dictionaries/jj_spoon.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/dictionaries/jj_spoon.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/dictionaries/jj_spoon.xml	(revision 487)
@@ -0,0 +1,10 @@
+<component name="ProjectDictionaryState">
+  <dictionary name="jj-spoon">
+    <words>
+      <w>alexeykuzmin</w>
+      <w>chai</w>
+      <w>jsonpointer</w>
+      <w>unescaped</w>
+    </words>
+  </dictionary>
+</component>
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/encodings.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/encodings.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/encodings.xml	(revision 487)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" />
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/inspectionProfiles/Project_Default.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/inspectionProfiles/Project_Default.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/inspectionProfiles/Project_Default.xml	(revision 487)
@@ -0,0 +1,38 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0" is_locked="false">
+    <option name="myName" value="Project Default" />
+    <option name="myLocal" value="false" />
+    <inspection_tool class="ConditionalExpressionWithIdenticalBranchesJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="CyclomaticComplexityJS" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_limit" value="10" />
+    </inspection_tool>
+    <inspection_tool class="DefaultNotLastCaseInSwitchJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="DuplicateConditionJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="FunctionWithMultipleLoopsJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="IfStatementWithIdenticalBranchesJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="IfStatementWithTooManyBranchesJS" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_limit" value="3" />
+    </inspection_tool>
+    <inspection_tool class="JSHint" enabled="true" level="ERROR" enabled_by_default="true" />
+    <inspection_tool class="LabeledStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="NestedSwitchStatementJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="NestingDepthJS" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_limit" value="5" />
+    </inspection_tool>
+    <inspection_tool class="ParametersPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_limit" value="5" />
+    </inspection_tool>
+    <inspection_tool class="StatementsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="m_limit" value="30" />
+    </inspection_tool>
+    <inspection_tool class="SwitchStatementWithNoDefaultBranchJS" enabled="true" level="WARNING" enabled_by_default="true" />
+    <inspection_tool class="TaskInspection" enabled="true" level="INFO" enabled_by_default="true">
+      <option name="suppressedTasks">
+        <set>
+          <option value="CoffeeScript" />
+        </set>
+      </option>
+    </inspection_tool>
+    <inspection_tool class="ThreeNegationsPerFunctionJS" enabled="true" level="WARNING" enabled_by_default="true" />
+  </profile>
+</component>
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/inspectionProfiles/profiles_settings.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/inspectionProfiles/profiles_settings.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/inspectionProfiles/profiles_settings.xml	(revision 487)
@@ -0,0 +1,7 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="PROJECT_PROFILE" value="Project Default" />
+    <option name="USE_PROJECT_PROFILE" value="true" />
+    <version value="1.0" />
+  </settings>
+</component>
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/jsLinters/jshint.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/jsLinters/jshint.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/jsLinters/jshint.xml	(revision 487)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JSHintConfiguration" version="1.0.0" use-config-file="false">
+    <option bitwise="true" />
+    <option curly="true" />
+    <option eqeqeq="true" />
+    <option forin="true" />
+    <option noarg="true" />
+    <option noempty="true" />
+    <option nonew="true" />
+    <option undef="true" />
+    <option strict="true" />
+    <option browser="true" />
+    <option maxerr="50" />
+  </component>
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/jsonpointer.js.iml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/jsonpointer.js.iml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/jsonpointer.js.iml	(revision 487)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/node_modules" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/misc.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/misc.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/misc.xml	(revision 487)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" />
+  <component name="SvnConfiguration" maxAnnotateRevisions="500" myUseAcceleration="nothing" myAutoUpdateAfterCommit="false" cleanupOnStartRun="false">
+    <option name="USER" value="" />
+    <option name="PASSWORD" value="" />
+    <option name="mySSHConnectionTimeout" value="30000" />
+    <option name="mySSHReadTimeout" value="30000" />
+    <option name="LAST_MERGED_REVISION" />
+    <option name="MERGE_DRY_RUN" value="false" />
+    <option name="MERGE_DIFF_USE_ANCESTRY" value="true" />
+    <option name="UPDATE_LOCK_ON_DEMAND" value="false" />
+    <option name="IGNORE_SPACES_IN_MERGE" value="false" />
+    <option name="DETECT_NESTED_COPIES" value="true" />
+    <option name="CHECK_NESTED_FOR_QUICK_MERGE" value="false" />
+    <option name="IGNORE_SPACES_IN_ANNOTATE" value="true" />
+    <option name="SHOW_MERGE_SOURCES_IN_ANNOTATE" value="true" />
+    <option name="FORCE_UPDATE" value="false" />
+    <option name="IGNORE_EXTERNALS" value="false" />
+    <myIsUseDefaultProxy>false</myIsUseDefaultProxy>
+  </component>
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/modules.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/modules.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/modules.xml	(revision 487)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/jsonpointer.js.iml" filepath="$PROJECT_DIR$/.idea/jsonpointer.js.iml" />
+    </modules>
+  </component>
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/scopes/scope_settings.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/scopes/scope_settings.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/scopes/scope_settings.xml	(revision 487)
@@ -0,0 +1,5 @@
+<component name="DependencyValidationManager">
+  <state>
+    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
+  </state>
+</component>
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/vcs.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/vcs.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/vcs.xml	(revision 487)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$" vcs="Git" />
+  </component>
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/workspace.xml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/workspace.xml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/.idea/workspace.xml	(revision 487)
@@ -0,0 +1,621 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="BuildServerSettings">
+    <option name="LOGIN" value="" />
+    <option name="SERVER_URL" value="http://buildserver" />
+    <option name="PASSWORD" />
+    <option name="REMEMBER_ME" value="true" />
+    <option name="USE_IDEA_PROXY_SETTINGS" value="true" />
+    <option name="TEST_STATUS_BUILD_TYPE_IDS" />
+    <option name="INSPECTIONS_BUILD_TYPE_IDS" />
+    <option name="DUPLICATES_BUILD_TYPE_IDS" />
+    <option name="COVERAGE_SETTINGS" />
+    <option name="ARTIFACTS_BUILD_TYPE_IDS" />
+    <option name="PERFORM_COMMIT_IF_SUCCESSFUL" value="true" />
+    <option name="PERFORM_COMMIT_IF_NO_NEW_FAILED_TESTS" value="false" />
+    <option name="REQUEST_CONFIRMATON" value="false" />
+    <option name="PRE_TESTED_COMMIT" value="true" />
+    <option name="PROJECT_STATUS_DIALOG_SPLITTER_DIVIDER_LOCATION" value="500" />
+    <option name="CHANGES_STATUS_DIALOG_SPLITTER_DIVIDER_LOCATION" value="500" />
+    <option name="FILTER_BY_STATUS" value="false" />
+    <option name="FILTER_MARKED_AS_FIXED" value="false" />
+    <option name="SHOW_CLOSE_PROMPT" value="true" />
+    <option name="TOOL_WINDOW_SELECTED_CONTENT_INDEX" value="0" />
+    <option name="FILTER_BY_CURRENT_PROJECT" value="true" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="abb6dcda-5b6f-4773-b830-e505df847e39" name="Default" comment="" />
+    <ignored path="js-json-pointer.iws" />
+    <ignored path=".idea/workspace.xml" />
+    <file path="/Dummy.txt" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1371299270803" ignored="false" />
+    <file path="/LICENSE" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365452334456" ignored="false" />
+    <file path="/a.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365700745335" ignored="false" />
+    <file path="/package.json" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1366107678700" ignored="false" />
+    <file path="/js-json-pointer.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365458437789" ignored="false" />
+    <file path="/.jshintrc" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365454980964" ignored="false" />
+    <file path="/test-js-json-pointer.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365457019451" ignored="false" />
+    <file path="/test-js-json-pointer.coffee" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365458872525" ignored="false" />
+    <file path="/Gruntfile.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365635020864" ignored="false" />
+    <file path="/.gitignore" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365461692687" ignored="false" />
+    <file path="/.travis.yml" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365462644917" ignored="false" />
+    <file path="/README.md" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1371253619511" ignored="false" />
+    <file path="/index.html" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365974375277" ignored="false" />
+    <file path="/testJsonPointer.coffee" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365710018267" ignored="false" />
+    <file path="/jsonPointer.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365712195023" ignored="false" />
+    <file path="/.npmignore" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365713643453" ignored="false" />
+    <file path="/jsonpointer.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1366479267891" ignored="false" />
+    <file path="/dummy.xml" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365875225949" ignored="false" />
+    <file path="/testJsonpointer.coffee" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1366389598709" ignored="false" />
+    <file path="/testJsonpointer.compiled.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365886926974" ignored="false" />
+    <file path="/main.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1366108802738" ignored="false" />
+    <file path="/Table.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1365961743938" ignored="false" />
+    <file path="/test.html" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1366108565874" ignored="false" />
+    <file path="$PROJECT_DIR$/../../yandex/browser/tablo/src/widgets/generic/src/ui/ui.js" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1371135028509" ignored="false" />
+    <file path="/a.dummy" changelist="abb6dcda-5b6f-4773-b830-e505df847e39" time="1371243124870" ignored="false" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+  <component name="CreatePatchCommitExecutor">
+    <option name="PATCH_PATH" value="" />
+  </component>
+  <component name="DaemonCodeAnalyzer">
+    <disable_hints />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
+  <component name="FavoritesManager">
+    <favorites_list name="js-json-pointer" />
+  </component>
+  <component name="FileEditorManager">
+    <leaf>
+      <file leaf-file-name="jsonpointer.js" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/src/jsonpointer.js">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="80" column="0" selection-start="2076" selection-end="2076" vertical-scroll-proportion="0.0">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="bower.json" pinned="false" current="false" current-in-tab="false">
+        <entry file="file://$PROJECT_DIR$/bower.json">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="2" column="19" selection-start="49" selection-end="49" vertical-scroll-proportion="-1.25">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+      <file leaf-file-name="package.json" pinned="false" current="true" current-in-tab="true">
+        <entry file="file://$PROJECT_DIR$/package.json">
+          <provider selected="true" editor-type-id="text-editor">
+            <state line="4" column="28" selection-start="134" selection-end="134" vertical-scroll-proportion="0.08368201">
+              <folding />
+            </state>
+          </provider>
+        </entry>
+      </file>
+    </leaf>
+  </component>
+  <component name="FindManager">
+    <FindUsagesManager>
+      <setting name="OPEN_NEW_TAB" value="false" />
+    </FindUsagesManager>
+  </component>
+  <component name="Git.Settings">
+    <option name="UPDATE_TYPE" value="REBASE" />
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
+    <option name="RECENT_BRANCH_BY_REPOSITORY">
+      <map>
+        <entry key="$PROJECT_DIR$" value="pr/1" />
+      </map>
+    </option>
+  </component>
+  <component name="GitLogSettings">
+    <option name="myDateState">
+      <MyDateState />
+    </option>
+  </component>
+  <component name="IdeDocumentHistory">
+    <option name="changedFiles">
+      <list>
+        <option value="$PROJECT_DIR$/src/index.html" />
+        <option value="$PROJECT_DIR$/src/Table.js" />
+        <option value="$PROJECT_DIR$/Gruntfile.js" />
+        <option value="$PROJECT_DIR$/test/index.html" />
+        <option value="$PROJECT_DIR$/src/test.html" />
+        <option value="$PROJECT_DIR$/src/main.js" />
+        <option value="$PROJECT_DIR$/component.json" />
+        <option value="$PROJECT_DIR$/benchmark/main.js" />
+        <option value="$PROJECT_DIR$/benchmark/jsonpointer.js" />
+        <option value="$PROJECT_DIR$/v8.log" />
+        <option value="$PROJECT_DIR$/profile/jsonpointer.js" />
+        <option value="$PROJECT_DIR$/test/testJsonpointer.coffee" />
+        <option value="$PROJECT_DIR$/README.md" />
+        <option value="$PROJECT_DIR$/src/jsonpointer.js" />
+        <option value="$PROJECT_DIR$/bower.json" />
+        <option value="$PROJECT_DIR$/package.json" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectFrameBounds">
+    <option name="y" value="22" />
+    <option name="width" value="1440" />
+    <option name="height" value="812" />
+  </component>
+  <component name="ProjectInspectionProfilesVisibleTreeState">
+    <entry key="Project Default">
+      <profile-state>
+        <expanded-state>
+          <State>
+            <id />
+          </State>
+          <State>
+            <id>ActionScript specificJavaScript</id>
+          </State>
+          <State>
+            <id>CSS</id>
+          </State>
+          <State>
+            <id>Code quality toolsJavaScript</id>
+          </State>
+          <State>
+            <id>CoffeeScript</id>
+          </State>
+          <State>
+            <id>Control flow issuesJavaScript</id>
+          </State>
+          <State>
+            <id>File Watchers</id>
+          </State>
+          <State>
+            <id>GeneralCoffeeScript</id>
+          </State>
+          <State>
+            <id>GeneralJavaScript</id>
+          </State>
+          <State>
+            <id>HTML</id>
+          </State>
+          <State>
+            <id>Internationalization issues</id>
+          </State>
+          <State>
+            <id>JavaScript</id>
+          </State>
+          <State>
+            <id>JavaScript function metricsJavaScript</id>
+          </State>
+          <State>
+            <id>JavaScript validity issuesJavaScript</id>
+          </State>
+          <State>
+            <id>Naming conventionsJavaScript</id>
+          </State>
+          <State>
+            <id>RELAX NG</id>
+          </State>
+          <State>
+            <id>XML</id>
+          </State>
+        </expanded-state>
+        <selected-state>
+          <State>
+            <id>Naming conventionsJavaScript</id>
+          </State>
+        </selected-state>
+      </profile-state>
+    </entry>
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectReloadState">
+    <option name="STATE" value="0" />
+  </component>
+  <component name="ProjectView">
+    <navigator currentView="ProjectPane" proportions="" version="1" splitterProportion="0.5">
+      <flattenPackages />
+      <showMembers />
+      <showModules />
+      <showLibraryContents ProjectPane="true" />
+      <hideEmptyPackages />
+      <abbreviatePackageNames />
+      <autoscrollToSource />
+      <autoscrollFromSource />
+      <sortByType />
+    </navigator>
+    <panes>
+      <pane id="Scope" />
+      <pane id="ProjectPane">
+        <subPane>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="jsonpointer.js" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="jsonpointer.js" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="jsonpointer.js" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="jsonpointer.js" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="jsonpointer.js" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="src" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
+            </PATH_ELEMENT>
+          </PATH>
+        </subPane>
+      </pane>
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="options.splitter.main.proportions" value="0.3" />
+    <property name="options.lastSelected" value="preferences.fileTypes" />
+    <property name="FullScreen" value="false" />
+    <property name="options.searchVisible" value="true" />
+    <property name="options.splitter.details.proportions" value="0.2" />
+  </component>
+  <component name="RecentsManager">
+    <key name="CopyFile.RECENT_KEYS">
+      <recent name="$PROJECT_DIR$/src/jam" />
+    </key>
+  </component>
+  <component name="RestoreUpdateTree">
+    <UpdateInfo date="Moments ago" ActionInfo="_Update">
+      <UpdatedFiles>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Updated from server" />
+          <option name="myStatusName" value="Changed on server" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="CHANGED_ON_SERVER" />
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Updated" />
+            <option name="myStatusName" value="Changed" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="false" />
+            <option name="myId" value="UPDATED" />
+            <PATH vcs="Git" revision="">$PROJECT_DIR$/Gruntfile.js</PATH>
+            <PATH vcs="Git" revision="">$PROJECT_DIR$/README.md</PATH>
+            <PATH vcs="Git" revision="">$PROJECT_DIR$/src/jsonpointer.js</PATH>
+            <PATH vcs="Git" revision="">$PROJECT_DIR$/test/testJsonpointer.coffee</PATH>
+          </FILE-GROUP>
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Created" />
+            <option name="myStatusName" value="Created" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="false" />
+            <option name="myId" value="CREATED" />
+          </FILE-GROUP>
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Deleted" />
+            <option name="myStatusName" value="Deleted" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="true" />
+            <option name="myId" value="REMOVED_FROM_REPOSITORY" />
+          </FILE-GROUP>
+          <FILE-GROUP>
+            <option name="myUpdateName" value="Restored" />
+            <option name="myStatusName" value="Will be restored" />
+            <option name="mySupportsDeletion" value="false" />
+            <option name="myCanBeAbsent" value="false" />
+            <option name="myId" value="RESTORED" />
+          </FILE-GROUP>
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Modified" />
+          <option name="myStatusName" value="Modified" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MODIFIED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Skipped" />
+          <option name="myStatusName" value="Skipped" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="SKIPPED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Merged with conflicts" />
+          <option name="myStatusName" value="Will be merged with conflicts" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MERGED_WITH_CONFLICTS" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Merged with tree conflicts" />
+          <option name="myStatusName" value="Merged with tree conflicts" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MERGED_WITH_TREE_CONFLICT" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Merged with property conflicts" />
+          <option name="myStatusName" value="Will be merged with property conflicts" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MERGED_WITH_PROPERTY_CONFLICT" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Merged" />
+          <option name="myStatusName" value="Will be merged" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="MERGED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Not in repository" />
+          <option name="myStatusName" value="Not in repository" />
+          <option name="mySupportsDeletion" value="true" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="UNKNOWN" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Locally added" />
+          <option name="myStatusName" value="Locally added" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="LOCALLY_ADDED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Locally removed" />
+          <option name="myStatusName" value="Locally removed" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="LOCALLY_REMOVED" />
+        </FILE-GROUP>
+        <FILE-GROUP>
+          <option name="myUpdateName" value="Switched" />
+          <option name="myStatusName" value="Switched" />
+          <option name="mySupportsDeletion" value="false" />
+          <option name="myCanBeAbsent" value="false" />
+          <option name="myId" value="SWITCHED" />
+        </FILE-GROUP>
+      </UpdatedFiles>
+    </UpdateInfo>
+  </component>
+  <component name="RunManager">
+    <configuration default="true" type="JavascriptDebugSession" factoryName="Local" singleton="true">
+      <JSDebuggerConfigurationSettings>
+        <option name="engineId" value="embedded" />
+        <option name="fileUrl" />
+      </JSDebuggerConfigurationSettings>
+      <method />
+    </configuration>
+    <list size="0" />
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false" />
+  <component name="ToolWindowManager">
+    <frame x="0" y="22" width="1440" height="812" extended-state="6" />
+    <editor active="true" />
+    <layout>
+      <window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.15277778" sideWeight="0.6710013" order="0" side_tool="false" content_ui="combo" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+      <window_info id="TeamCity" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32899868" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+    </layout>
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="VcsManagerConfiguration">
+    <option name="OFFER_MOVE_TO_ANOTHER_CHANGELIST_ON_PARTIAL_COMMIT" value="true" />
+    <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="CHECK_NEW_TODO" value="false" />
+    <option name="myTodoPanelSettings">
+      <value>
+        <are-packages-shown value="false" />
+        <are-modules-shown value="false" />
+        <flatten-packages value="false" />
+        <is-autoscroll-to-source value="false" />
+      </value>
+    </option>
+    <option name="PERFORM_UPDATE_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_COMMIT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_EDIT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_CHECKOUT_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_ADD_REMOVE_IN_BACKGROUND" value="true" />
+    <option name="PERFORM_ROLLBACK_IN_BACKGROUND" value="false" />
+    <option name="CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND" value="false" />
+    <option name="CHANGED_ON_SERVER_INTERVAL" value="60" />
+    <option name="SHOW_ONLY_CHANGED_IN_SELECTION_DIFF" value="true" />
+    <option name="CHECK_COMMIT_MESSAGE_SPELLING" value="true" />
+    <option name="DEFAULT_PATCH_EXTENSION" value="patch" />
+    <option name="SHORT_DIFF_HORIZONTALLY" value="true" />
+    <option name="SHORT_DIFF_EXTRA_LINES" value="2" />
+    <option name="SOFT_WRAPS_IN_SHORT_DIFF" value="true" />
+    <option name="INCLUDE_TEXT_INTO_PATCH" value="false" />
+    <option name="INCLUDE_TEXT_INTO_SHELF" value="false" />
+    <option name="SHOW_FILE_HISTORY_DETAILS" value="true" />
+    <option name="SHOW_VCS_ERROR_NOTIFICATIONS" value="true" />
+    <option name="SHOW_DIRTY_RECURSIVELY" value="false" />
+    <option name="LIMIT_HISTORY" value="true" />
+    <option name="MAXIMUM_HISTORY_ROWS" value="1000" />
+    <option name="UPDATE_FILTER_SCOPE_NAME" />
+    <option name="USE_COMMIT_MESSAGE_MARGIN" value="false" />
+    <option name="COMMIT_MESSAGE_MARGIN_SIZE" value="72" />
+    <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="false" />
+    <option name="FORCE_NON_EMPTY_COMMENT" value="false" />
+    <option name="CLEAR_INITIAL_COMMIT_MESSAGE" value="false" />
+    <option name="LAST_COMMIT_MESSAGE" value="Bump version to 0.3.0" />
+    <option name="MAKE_NEW_CHANGELIST_ACTIVE" value="false" />
+    <option name="OPTIMIZE_IMPORTS_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="CHECK_FILES_UP_TO_DATE_BEFORE_COMMIT" value="false" />
+    <option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="false" />
+    <option name="REFORMAT_BEFORE_FILE_COMMIT" value="false" />
+    <option name="FILE_HISTORY_DIALOG_COMMENTS_SPLITTER_PROPORTION" value="0.8" />
+    <option name="FILE_HISTORY_DIALOG_SPLITTER_PROPORTION" value="0.5" />
+    <option name="ACTIVE_VCS_NAME" />
+    <option name="UPDATE_GROUP_BY_PACKAGES" value="false" />
+    <option name="UPDATE_GROUP_BY_CHANGELIST" value="false" />
+    <option name="UPDATE_FILTER_BY_SCOPE" value="false" />
+    <option name="SHOW_FILE_HISTORY_AS_TREE" value="false" />
+    <option name="FILE_HISTORY_SPLITTER_PROPORTION" value="0.6" />
+    <MESSAGE value="Bump version to 0.1.2" />
+    <MESSAGE value="Simplify detection of global object" />
+    <MESSAGE value="Add author email to package.json" />
+    <MESSAGE value="Use 'spec' reporter for Mocha tests results" />
+    <MESSAGE value="Support &quot;mocha-phantomjs&quot; for testing" />
+    <MESSAGE value="Update README.md&#10;&#10;Insignificant syntax fixes" />
+    <MESSAGE value="Fix comment" />
+    <MESSAGE value="Add link to AMD wiki in README" />
+    <MESSAGE value="Bump version to 0.1.3" />
+    <MESSAGE value="Update README.md&#10;&#10;Rephrase header of exceptions list." />
+    <MESSAGE value="Add tests for .get() call w/o second argument" />
+    <MESSAGE value="Fix description of test" />
+    <MESSAGE value="Return function if .get() called w/o second argument" />
+    <MESSAGE value="Update README.md&#10;&#10;Add example of .get() call w/o second argument." />
+    <MESSAGE value="Bump version to 0.2.0" />
+    <MESSAGE value="Update README.md&#10;&#10;Use only single quotes in JS examples" />
+    <MESSAGE value="Change &quot;json-pointer&quot; to &quot;jsonpointer&quot; in package.json" />
+    <MESSAGE value="Fix comment text" />
+    <MESSAGE value="Cache evaluation results" />
+    <MESSAGE value="Bump version to 0.2.1" />
+    <MESSAGE value="Fix JSDoc" />
+    <MESSAGE value="Fix tests&#10;&#10;- remove unnecessary curly braces&#10;- fix tests descriptions" />
+    <MESSAGE value="Update README&#10;&#10;- update description of possible types of `get()` first argument &#10;- update code examples&#10;- minor fixes" />
+    <MESSAGE value="component.json -&gt; bower.json" />
+    <MESSAGE value="Bump version to 0.3.0" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager />
+  </component>
+  <component name="editorHistoryManager">
+    <entry file="file://$PROJECT_DIR$/src/jsonpointer.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="131" column="52" selection-start="3581" selection-end="3581" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/jsonpointer.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="265" column="3" selection-start="7673" selection-end="7673" vertical-scroll-proportion="0.0" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/LICENSE">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="11" column="0" selection-start="628" selection-end="628" vertical-scroll-proportion="0.21262887" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/.gitignore">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="3" column="9" selection-start="51" selection-end="51" vertical-scroll-proportion="0.05798969" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/.travis.yml">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="3" column="9" selection-start="46" selection-end="46" vertical-scroll-proportion="0.05798969" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/test/testJsonpointer.compiled.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="1" column="20" selection-start="34" selection-end="34" vertical-scroll-proportion="0.019329896" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/test/index.html">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="26" column="32" selection-start="879" selection-end="879" vertical-scroll-proportion="0.60747665" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/Gruntfile.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="43" column="18" selection-start="735" selection-end="735" vertical-scroll-proportion="0.46391752" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/.npmignore">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="5" column="12" selection-start="71" selection-end="71" vertical-scroll-proportion="0.0697026" />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/.jshintrc">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="8" column="16" selection-start="140" selection-end="140" vertical-scroll-proportion="0.11406844" />
+      </provider>
+    </entry>
+    <entry file="jar://$APPLICATION_HOME_DIR$/plugins/JavaScriptLanguage/lib/JavascriptLanguage.jar!/com/intellij/lang/javascript/index/predefined/EcmaScript.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="104" column="9" selection-start="1612" selection-end="1612" vertical-scroll-proportion="0.33333334">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/test/testJsonpointer.coffee">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="68" column="23" selection-start="1534" selection-end="1534" vertical-scroll-proportion="0.29419702">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/README.md">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="58" column="56" selection-start="1562" selection-end="1562" vertical-scroll-proportion="0.33613446">
+          <folding />
+        </state>
+      </provider>
+      <provider editor-type-id="MarkdownPreviewEditor">
+        <state />
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/src/jsonpointer.js">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="80" column="0" selection-start="2076" selection-end="2076" vertical-scroll-proportion="0.0">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/bower.json">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="2" column="19" selection-start="49" selection-end="49" vertical-scroll-proportion="-1.25">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+    <entry file="file://$PROJECT_DIR$/package.json">
+      <provider selected="true" editor-type-id="text-editor">
+        <state line="4" column="28" selection-start="134" selection-end="134" vertical-scroll-proportion="0.08368201">
+          <folding />
+        </state>
+      </provider>
+    </entry>
+  </component>
+</project>
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/LICENSE	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2013 Alexey Kuzmin (http://github.com/alexeykuzmin)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/README.md	(revision 487)
@@ -0,0 +1,85 @@
+# JavaScript JSON Pointer
+
+[![Build Status](https://travis-ci.org/alexeykuzmin/jsonpointer.js.png)](https://travis-ci.org/alexeykuzmin/jsonpointer.js)
+[![Dependency Status](https://gemnasium.com/alexeykuzmin/jsonpointer.js.png)](https://gemnasium.com/alexeykuzmin/jsonpointer.js)
+[![NPM Version](https://badge.fury.io/js/jsonpointer.js.png)](https://npmjs.org/package/jsonpointer.js)
+
+JavaScript implementation of JSON Pointer ([RFC 6901](http://tools.ietf.org/html/rfc6901)).  
+Can be used as Node.js package, AMD module or a plain script.
+
+
+## Installation
+
+via [npm](https://npmjs.org/):
+
+    $ npm install jsonpointer.js
+    
+via [Bower](http://twitter.github.io/bower/):
+
+    $ bower install jsonpointer.js
+    
+or copy `src/jsonpointer.js` file from repo.
+
+
+## Include
+###Node.js
+```js
+var jsonpoiner = require('jsonpointer.js');  // XXX: '.js' is part of package name!
+console.log(typeof jsonpointer);  // 'object'
+```
+
+###[AMD](https://github.com/amdjs/amdjs-api/wiki/AMD)
+```js
+require('jsonpointer', function(jsonpointer) {
+  console.log(typeof jsonpointer);  // 'object'
+});
+```
+
+### &lt;script&gt; tag
+```html
+<script src="/path/to/jsonpointer.js" type="text/javascript"></script>
+<script>
+   console.log(typeof window.jsonpointer);  // 'object'
+</script>
+```
+
+## API
+### jsonpointer.get
+
+`get()` accepts strings, objects and arrays as evaluation target.
+```js
+var target = {
+  foo: {
+    bar: 'foobar'
+  },
+  baz: [true, false],
+  '~': 'tilde',
+  '/': 'slash'
+});
+
+var targetJSON = JSON.stringify(target);
+
+jsonpointer.get(target, '/foo');  // {bar: 'foobar'}
+jsonpointer.get(target, '/foo/bar');  // 'foobar'
+jsonpointer.get(target, '/some/nonexisting/path');  // undefined
+jsonpointer.get(target, '/~0');  // 'tilde'
+jsonpointer.get(targetJSON, '/~1');  // 'slash'
+jsonpointer.get(targetJSON, '/baz');  // [true, false]
+jsonpointer.get(targetJSON, '/baz/0');  // true
+jsonpointer.get(targetJSON, '/baz/2');  // undefined
+```
+
+Second argument might be omitted, in such case `get()` returns a function
+that takes pointer as argument and evaluates it.
+```js
+var evaluate = jsonpointer.get(target);
+evaluate('/foo/bar');  // 'foobar'
+```
+
+There are several cases when `.get()` throws an exception:
+
+ - First argument is not string, object or array.
+ - First argument is string but is not valid JSON string.
+ - Seconds argument is not valid JSON Pointer string.
+ - Unacceptable token met during evaluation (check [section 4 of spec](http://tools.ietf.org/html/rfc6901#section-4) for examples).
+ - `'-'` token used in JSON Pointer string and it's going to be evaluated in `Array` context.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/bower.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/bower.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/bower.json	(revision 487)
@@ -0,0 +1,12 @@
+{
+  "name": "jsonpointer.js",
+  "version": "0.3.0",
+  "main": "src/jsonpointer.js",
+  "ignore": [
+    "**/.*",
+    "Gruntfile.js",
+    "package.json",
+    "node_modules",
+    "test/"
+  ]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/package.json	(revision 487)
@@ -0,0 +1,48 @@
+{
+  "name": "jsonpointer.js",
+  "description": "JavaScript implementation of JSON Pointer",
+  "author": {
+    "name": "Alexey Kuzmin",
+    "email": "alex.s.kuzmin@gmail.com"
+  },
+  "version": "0.3.0",
+  "preferGlobal": false,
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/alexeykuzmin/jsonpointer.js.git"
+  },
+  "homepage": "https://github.com/alexeykuzmin/jsonpointer.js",
+  "bugs": {
+    "url": "https://github.com/alexeykuzmin/jsonpointer.js/issues"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "devDependencies": {
+    "chai": "~1.5.0",
+    "grunt": "~0.4.1",
+    "grunt-contrib-jshint": "~0.4.2",
+    "grunt-coffeelint": "0.0.6",
+    "grunt-simple-mocha": "~0.4.0",
+    "grunt-contrib-coffee": "~0.6.6",
+    "mocha": "~1.9.0"
+  },
+  "readmeFilename": "README.md",
+  "main": "src/jsonpointer",
+  "directories": {
+    "test": "test"
+  },
+  "dependencies": {},
+  "keywords": [
+    "jsonpointer",
+    "json"
+  ],
+  "license": "MIT",
+  "readme": "# JavaScript JSON Pointer\n\n[![Build Status](https://travis-ci.org/alexeykuzmin/jsonpointer.js.png)](https://travis-ci.org/alexeykuzmin/jsonpointer.js)\n[![Dependency Status](https://gemnasium.com/alexeykuzmin/jsonpointer.js.png)](https://gemnasium.com/alexeykuzmin/jsonpointer.js)\n[![NPM Version](https://badge.fury.io/js/jsonpointer.js.png)](https://npmjs.org/package/jsonpointer.js)\n\nJavaScript implementation of JSON Pointer ([RFC 6901](http://tools.ietf.org/html/rfc6901)).  \nCan be used as Node.js package, AMD module or a plain script.\n\n\n## Installation\n\nvia [npm](https://npmjs.org/):\n\n    $ npm install jsonpointer.js\n    \nvia [Bower](http://twitter.github.io/bower/):\n\n    $ bower install jsonpointer.js\n    \nor copy `src/jsonpointer.js` file from repo.\n\n\n## Include\n###Node.js\n```js\nvar jsonpoiner = require('jsonpointer.js');  // XXX: '.js' is part of package name!\nconsole.log(typeof jsonpointer);  // 'object'\n```\n\n###[AMD](https://github.com/amdjs/amdjs-api/wiki/AMD)\n```js\nrequire('jsonpointer', function(jsonpointer) {\n  console.log(typeof jsonpointer);  // 'object'\n});\n```\n\n### &lt;script&gt; tag\n```html\n<script src=\"/path/to/jsonpointer.js\" type=\"text/javascript\"></script>\n<script>\n   console.log(typeof window.jsonpointer);  // 'object'\n</script>\n```\n\n## API\n### jsonpointer.get\n\n`get()` accepts strings, objects and arrays as evaluation target.\n```js\nvar target = {\n  foo: {\n    bar: 'foobar'\n  },\n  baz: [true, false],\n  '~': 'tilde',\n  '/': 'slash'\n});\n\nvar targetJSON = JSON.stringify(target);\n\njsonpointer.get(target, '/foo');  // {bar: 'foobar'}\njsonpointer.get(target, '/foo/bar');  // 'foobar'\njsonpointer.get(target, '/some/nonexisting/path');  // undefined\njsonpointer.get(target, '/~0');  // 'tilde'\njsonpointer.get(targetJSON, '/~1');  // 'slash'\njsonpointer.get(targetJSON, '/baz');  // [true, false]\njsonpointer.get(targetJSON, '/baz/0');  // true\njsonpointer.get(targetJSON, '/baz/2');  // undefined\n```\n\nSecond argument might be omitted, in such case `get()` returns a function\nthat takes pointer as argument and evaluates it.\n```js\nvar evaluate = jsonpointer.get(target);\nevaluate('/foo/bar');  // 'foobar'\n```\n\nThere are several cases when `.get()` throws an exception:\n\n - First argument is not string, object or array.\n - First argument is string but is not valid JSON string.\n - Seconds argument is not valid JSON Pointer string.\n - Unacceptable token met during evaluation (check [section 4 of spec](http://tools.ietf.org/html/rfc6901#section-4) for examples).\n - `'-'` token used in JSON Pointer string and it's going to be evaluated in `Array` context.\n",
+  "_id": "jsonpointer.js@0.3.0",
+  "dist": {
+    "shasum": "932bbd87badc3b2d2634aeaf7be5eae790967294"
+  },
+  "_from": "jsonpointer.js@0.3.0",
+  "_resolved": "https://registry.npmjs.org/jsonpointer.js/-/jsonpointer.js-0.3.0.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/src/jsonpointer.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/src/jsonpointer.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/jsonpointer.js/src/jsonpointer.js	(revision 487)
@@ -0,0 +1,343 @@
+/**
+ * @author Alexey Kuzmin <alex.s.kuzmin@gmail.com>
+ * @fileoverview JavaScript implementation of JSON Pointer.
+ * @see http://tools.ietf.org/html/rfc6901
+ */
+
+
+
+;(function() {
+  'use strict';
+
+  /**
+   * List of special characters and their escape sequences.
+   * Special characters will be unescaped in order they are listed.
+   * Section 3 of spec.
+   * @type {Array.<Array.<string>>}
+   * @const
+   */
+  var SPECIAL_CHARACTERS = [
+    ['/', '~1'],
+    ['~', '~0']
+  ];
+
+
+  /**
+   * Tokens' separator in JSON pointer string.
+   * Section 3 of spec.
+   * @type {string}
+   * @const
+   */
+  var TOKENS_SEPARATOR = '/';
+
+
+  /**
+   * Prefix for error messages.
+   * @type {string}
+   * @const
+   */
+  var ERROR_MESSAGE_PREFIX = 'JSON Pointer: ';
+
+
+  /**
+   * Validates non-empty pointer string.
+   * @type {RegExp}
+   * @const
+   */
+  var NON_EMPTY_POINTER_REGEXP = /(\/[^\/]*)+/;
+
+
+  /**
+   * List of error messages.
+   * Please keep it in alphabetical order.
+   * @enum {string}
+   */
+  var ErrorMessage = {
+    HYPHEN_IS_NOT_SUPPORTED_IN_ARRAY_CONTEXT:
+        'Implementation does not support "-" token for arrays.',
+    INVALID_DOCUMENT: 'JSON document is not valid.',
+    INVALID_DOCUMENT_TYPE: 'JSON document must be a string or object.',
+    INVALID_POINTER: 'Pointer is not valid.',
+    NON_NUMBER_TOKEN_IN_ARRAY_CONTEXT:
+        'Non-number tokens cannot be used in array context.',
+    TOKEN_WITH_LEADING_ZERO_IN_ARRAY_CONTEXT:
+        'Token with leading zero cannot be used in array context.'
+  };
+
+
+  /**
+   * Returns |target| object's value pointed by |opt_pointer|, returns undefined
+   * if |opt_pointer| points to non-existing value.
+   * If pointer is not provided, validates first argument and returns
+   * evaluator function that takes pointer as argument.
+   * @param {(string|Object|Array)} target Evaluation target.
+   * @param {string=} opt_pointer JSON Pointer string.
+   * @returns {*} Some value.
+   */
+  function getPointedValue(target, opt_pointer) {
+    // .get() method implementation.
+
+    // First argument must be either string or object.
+    if (isString(target)) {
+
+      // If string it must be valid JSON document.
+      try {
+        // Let's try to parse it as JSON.
+        target = JSON.parse(target);
+      }
+      catch (e) {
+        // If parsing failed, an exception will be thrown.
+        throw getError(ErrorMessage.INVALID_DOCUMENT);
+      }
+    }
+    else if (!isObject(target)) {
+      // If not object or string, an exception will be thrown.
+      throw getError(ErrorMessage.INVALID_DOCUMENT_TYPE);
+    }
+
+    // |target| is already parsed, let's create evaluator function for it.
+    var evaluator = createPointerEvaluator(target);
+
+    if (isUndefined(opt_pointer)) {
+      // If pointer was not provided, return evaluator function.
+      return evaluator;
+    }
+    else {
+      // If pointer is provided, return evaluation result.
+      return evaluator(opt_pointer);
+    }
+  }
+
+
+  /**
+   * Returns function that takes JSON Pointer as single argument
+   * and evaluates it in given |target| context.
+   * Returned function throws an exception if pointer is not valid
+   * or any error occurs during evaluation.
+   * @param {*} target Evaluation target.
+   * @returns {Function}
+   */
+  function createPointerEvaluator(target) {
+
+    // Use cache to store already received values.
+    var cache = {};
+
+    return function(pointer) {
+
+      if (!isValidJSONPointer(pointer)) {
+        // If it's not, an exception will be thrown.
+        throw getError(ErrorMessage.INVALID_POINTER);
+      }
+
+      // First, look up in the cache.
+      if (cache.hasOwnProperty(pointer)) {
+        // If cache entry exists, return it's value.
+        return cache[pointer];
+      }
+
+      // Now, when all arguments are valid, we can start evaluation.
+      // First of all, let's convert JSON pointer string to tokens list.
+      var tokensList = parsePointer(pointer);
+      var token;
+      var value = target;
+
+      // Evaluation will be continued till tokens list is not empty
+      // and returned value is not an undefined.
+      while (!isUndefined(value) && !isUndefined(token = tokensList.pop())) {
+        // Let's evaluate token in current context.
+        // `getValue()` might throw an exception, but we won't handle it.
+        value = getValue(value, token);
+      }
+
+      // Pointer evaluation is done, save value in the cache and return it.
+      cache[pointer] = value;
+      return value;
+    };
+  }
+
+
+  /**
+   * Returns true if given |pointer| is valid, returns false otherwise.
+   * @param {!string} pointer
+   * @returns {boolean} Whether pointer is valid.
+   */
+  function isValidJSONPointer(pointer) {
+    // Validates JSON pointer string.
+
+    if (!isString(pointer)) {
+      // If it's not a string, it obviously is not valid.
+      return false;
+    }
+
+    if ('' === pointer) {
+      // If it is string and is an empty string, it's valid.
+      return true;
+    }
+
+    // If it is non-empty string, it must match spec defined format.
+    // Check Section 3 of specification for concrete syntax.
+    return NON_EMPTY_POINTER_REGEXP.test(pointer);
+  }
+
+
+  /**
+   * Returns tokens list for given |pointer|. List is reversed, e.g.
+   *     '/simple/path' -> ['path', 'simple']
+   * @param {!string} pointer JSON pointer string.
+   * @returns {Array} List of tokens.
+   */
+  function parsePointer(pointer) {
+    // Converts JSON pointer string into tokens list.
+
+    // Let's split pointer string by tokens' separator character.
+    // Also we will reverse resulting array to simplify it's further usage.
+    var tokens = pointer.split(TOKENS_SEPARATOR).reverse();
+
+    // Last item in resulting array is always an empty string,
+    // we don't need it, let's remove it.
+    tokens.pop();
+
+    // Now tokens' array is ready to use, let's return it.
+    return tokens;
+  }
+
+
+  /**
+   * Decodes all escape sequences in given |rawReferenceToken|.
+   * @param {!string} rawReferenceToken
+   * @returns {string} Unescaped reference token.
+   */
+  function unescapeReferenceToken(rawReferenceToken) {
+    // Unescapes reference token. See Section 3 of specification.
+
+    var referenceToken = rawReferenceToken;
+    var character;
+    var escapeSequence;
+    var replaceRegExp;
+
+    // Order of unescaping does matter.
+    // That's why an array is used here and not hash.
+    SPECIAL_CHARACTERS.forEach(function(pair) {
+      character = pair[0];
+      escapeSequence = pair[1];
+      replaceRegExp = new RegExp(escapeSequence, 'g');
+      referenceToken = referenceToken.replace(replaceRegExp, character);
+    });
+
+    return referenceToken;
+  }
+
+
+  /**
+   * Returns value pointed by |token| in evaluation |context|.
+   * Throws an exception if any error occurs.
+   * @param {*} context Current evaluation context.
+   * @param {!string} token Unescaped reference token.
+   * @returns {*} Some value or undefined if value if not found.
+   */
+  function getValue(context, token) {
+    // Reference token evaluation. See Section 4 of spec.
+
+    // First of all we should unescape all special characters in token.
+    token = unescapeReferenceToken(token);
+
+    // Further actions depend of context of evaluation.
+
+    if (isArray(context)) {
+      // In array context there are more strict requirements
+      // for token value.
+
+      if ('-' === token) {
+        // Token cannot be a "-" character,
+        // it has no sense in current implementation.
+        throw getError(ErrorMessage.HYPHEN_IS_NOT_SUPPORTED_IN_ARRAY_CONTEXT);
+      }
+      if (!isNumber(token)) {
+        // Token cannot be non-number.
+        throw getError(ErrorMessage.NON_NUMBER_TOKEN_IN_ARRAY_CONTEXT);
+      }
+      if (token.length > 1 && '0' === token[0]) {
+        // Token cannot be non-zero number with leading zero.
+        throw getError(ErrorMessage.TOKEN_WITH_LEADING_ZERO_IN_ARRAY_CONTEXT);
+      }
+      // If all conditions are met, simply return element
+      // with token's value index.
+      // It might be undefined, but it's ok.
+      return context[token];
+    }
+
+    if (isObject(context)) {
+      // In object context we can simply return element w/ key equal to token.
+      // It might be undefined, but it's ok.
+      return context[token];
+    }
+
+    // If context is not an array or an object,
+    // token evaluation is not possible.
+    // This is the expected situation and so we won't throw an error,
+    // undefined value is perfectly suitable here.
+    return;
+  }
+
+
+  /**
+   * Returns Error instance for throwing.
+   * @param {string} message Error message.
+   * @returns {Error}
+   */
+  function getError(message) {
+    return new Error(ERROR_MESSAGE_PREFIX + message);
+  }
+
+
+  function isObject(o) {
+    return 'object' === typeof o && null !== o;
+  }
+
+
+  function isArray(a) {
+    return Array.isArray(a);
+  }
+
+
+  function isNumber(n) {
+    return !isNaN(Number(n));
+  }
+
+
+  function isString(s) {
+    return 'string' === typeof s || s instanceof String;
+  }
+
+
+  function isUndefined(v) {
+    return 'undefined' === typeof v;
+  }
+
+
+  // Let's expose API to the world.
+
+  var jsonpointer = {
+    get: getPointedValue
+  };
+
+  if ('object' === typeof exports) {
+    // If `exports` is an object, we are in Node.js context.
+    // We are supposed to act as Node.js package.
+    module.exports = jsonpointer;
+  } else if ('function' === typeof define && define.amd) {
+    // If there is global function `define()` and `define.amd` is defined,
+    // we are supposed to act as AMD module.
+    define(function() {
+      return jsonpointer;
+    });
+  } else {
+    // Last resort.
+    // Let's create global `jsonpointer` object.
+    this.jsonpointer = jsonpointer;
+  }
+
+}).call((function() {
+  'use strict';
+  return (typeof window !== 'undefined' ? window : global);
+})());
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/LICENSE-MIT
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/LICENSE-MIT	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/LICENSE-MIT	(revision 487)
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Bart van der Schoor
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/ansi.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/ansi.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/ansi.js	(revision 487)
@@ -0,0 +1,120 @@
+/*
+
+ ministyle
+
+ https://github.com/Bartvds/ministyle
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003 */
+/*jshint -W115 */
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	//for console logging
+	function ansi() {
+		var mw = core.base();
+
+		mw.error = function (str) {
+			return '\x1B[31m' + str + '\x1B[0m';
+		};
+		mw.warning = function (str) {
+			return '\x1B[33m' + str + '\x1B[0m';
+		};
+		mw.success = function (str) {
+			return '\x1B[32m' + str + '\x1B[0m';
+		};
+		mw.accent = function (str) {
+			return '\x1B[36m' + str + '\x1B[0m';
+		};
+		mw.signal = function (str) {
+			return '\x1B[35m' + str + '\x1B[0m';
+		};
+		mw.muted = function (str) {
+			return '\x1B[90m' + str + '\x1B[0m';
+		};
+		mw.plain = function (str) {
+			return String(str);
+		};
+		mw.toString = function () {
+			return '<ministyle-ansi>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// for console logging (depending on colors.js getters)
+	function colorjs() {
+		//TODO assert props?
+		var mw = core.base();
+
+		mw.error = function (str) {
+			return String(str).red;
+		};
+		mw.warning = function (str) {
+			return String(str).yellow;
+		};
+		mw.success = function (str) {
+			return String(str).green;
+		};
+		mw.accent = function (str) {
+			return String(str).cyan;
+		};
+		mw.signal = function (str) {
+			return String(str).magenta;
+		};
+		mw.muted = function (str) {
+			return String(str).grey;
+		};
+		mw.plain = function (str) {
+			return String(str);
+		};
+		mw.toString = function () {
+			return '<ministyle-colorjs>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var common = {
+		ansi: ansi,
+		colorjs: colorjs,
+		grunt: colorjs
+	};
+
+	module.exports = common;
+
+}).call();
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/common.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/common.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/common.js	(revision 487)
@@ -0,0 +1,143 @@
+/*
+
+ ministyle
+
+ https://github.com/Bartvds/ministyle
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+//TODO find efficient code generator to cut down repetitive blocks
+// without unnecessary property-by-string lookups or wrapper closures
+//TODO freeze some props
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003 */
+/*jshint -W115 */
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// plain text
+	function plain() {
+		var mw = core.base();
+
+		mw.plain = function (str) {
+			return String(str);
+		};
+		mw.error = function (str) {
+			return mw.plain(str);
+		};
+		mw.warning = function (str) {
+			return mw.plain(str);
+		};
+		mw.success = function (str) {
+			return mw.plain(str);
+		};
+		mw.accent = function (str) {
+			return mw.plain(str);
+		};
+		mw.muted = function (str) {
+			return mw.plain(str);
+		};
+		mw.toString = function () {
+			return '<ministyle-plain>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	//TODO inline wrap method
+
+	// debug wrappers
+	function dev() {
+		var mw = core.base();
+		mw.error = function (str) {
+			return '[error|' + str + ']';
+		};
+		mw.warning = function (str) {
+			return '[warng|' + str + ']';
+		};
+		mw.success = function (str) {
+			return '[succs|' + str + ']';
+		};
+		mw.accent = function (str) {
+			return '[accnt|' + str + ']';
+		};
+		mw.signal = function (str) {
+			return '[signl|' + str + ']';
+		};
+		mw.muted = function (str) {
+			return '[muted|' + str + ']';
+		};
+		mw.plain = function (str) {
+			return'[plain|' + str + ']';
+		};
+		mw.toString = function () {
+			return '<ministyle-dev>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// return empty spaces
+	function empty() {
+		var mw = plain();
+
+		mw.plain = function (str) {
+			str = String(str);
+			var ret = '';
+			for (var i = 0; i < str.length; i++) {
+				ret += ' ';
+			}
+			return ret;
+		};
+		mw.toString = function () {
+			return '<ministyle-empty>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var common = {
+		plain: plain,
+		dev: dev,
+		empty: empty
+	};
+
+	module.exports = common;
+
+}).call();
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/core.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/core.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/core.js	(revision 487)
@@ -0,0 +1,148 @@
+/*
+
+ ministyle
+
+ https://github.com/Bartvds/ministyle
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003*/
+
+(function () {
+	'use strict';
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	var styleMap = {
+		'error': 'error',
+		'warning': 'warng',
+		'success': 'succs',
+		'accent': 'accnt',
+		'signal': 'signl',
+		'muted': 'muted',
+		'plain': 'plain'
+	};
+
+	function getStyleNames() {
+		return Object.keys(styleMap);
+	}
+
+	function getStyleShort() {
+		return Object.keys(styleMap).map(function (name) {
+			return styleMap[name];
+		});
+	}
+
+	function getStyleMap() {
+		return Object.keys(styleMap).reduce(function (memo, name) {
+			memo[name] = styleMap[name];
+			return memo;
+		}, {});
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function plainString(str) {
+		return String(str);
+	}
+
+	var miniRoot = {
+		error: plainString,
+		warning: plainString,
+		success: plainString,
+		accent: plainString,
+		signal: plainString,
+		muted: plainString,
+		plain: plainString,
+		toString: function () {
+			return '<ministyle>';
+		}
+	};
+
+	var miniBase = Object.create(miniRoot);
+
+	function setBase(def) {
+		assertMiniStyle(def);
+		miniBase = def;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function checkMiniStyle(target, first) {
+		if (!target || typeof target !== 'object' || Array.isArray(target)) {
+			return null;
+		}
+		var missing = [];
+		var styleNames = getStyleNames();
+		for (var i = 0; i < styleNames.length; i++) {
+			if (typeof target[styleNames[i]] !== 'function') {
+				if (first) {
+					return null;
+				}
+				missing.push(styleNames[i]);
+			}
+		}
+		return missing;
+	}
+
+	function isMiniStyle(target) {
+		return !!checkMiniStyle(target, true);
+	}
+
+	function assertMiniStyle(target) {
+		var dontHave = checkMiniStyle(target, false);
+		if (!dontHave || dontHave.length > 0) {
+			throw new Error('target is missing required methods: ' + dontHave.join());
+		}
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// factories
+	function base() {
+		return Object.create(miniBase);
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var core = {
+		assertMiniStyle: assertMiniStyle,
+		checkMiniStyle: checkMiniStyle,
+		isMiniStyle: isMiniStyle,
+		getStyleNames: getStyleNames,
+		getStyleShort: getStyleShort,
+		getStyleMap: getStyleMap,
+		setBase: setBase,
+
+		base: base
+	};
+
+	module.exports = core;
+
+}).call();
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/flow.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/flow.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/flow.js	(revision 487)
@@ -0,0 +1,303 @@
+/*
+
+ ministyle
+
+ https://github.com/Bartvds/ministyle
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003*/
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+	var common = require('./common');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function isArray(obj) {
+		return (Object.prototype.toString.call(obj) === '[object Array]');
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// toggle flow
+	function toggle(main, alt) {
+		var mw = core.base();
+		mw.enabled = true;
+		mw.main = main;
+		mw.alt = (alt || common.plain());
+		mw.active = mw.main;
+
+		mw.swap = function () {
+			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
+		};
+		mw.error = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.error(str);
+			}
+			return str;
+		};
+		mw.warning = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.warning(str);
+			}
+			return str;
+		};
+		mw.success = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.error(str);
+			}
+			return str;
+		};
+		mw.accent = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.accent(str);
+			}
+			return str;
+		};
+		mw.signal = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.signal(str);
+			}
+			return str;
+		};
+		mw.muted = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.muted(str);
+			}
+			return str;
+		};
+		mw.plain = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.active) {
+				return mw.active.plain(str);
+			}
+			return str;
+		};
+		mw.toString = function () {
+			return '<ministyle-toggle>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// peek with callback and control output
+	function peek(callback, main, alt) {
+		var mw = core.base();
+		mw.enabled = true;
+		mw.main = (main || common.plain());
+		mw.alt = (alt || common.plain());
+		mw.callback = (callback || function (str, def /*, type, main, alt*/) {
+			return def(String(str));
+		});
+
+		mw.error = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.error, 'error', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.error(str);
+				}
+				return tmp;
+			}
+			return mw.alt.error(str);
+		};
+		mw.warning = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.warning, 'warning', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.warning(str);
+				}
+				return tmp;
+			}
+			return mw.alt.warning(str);
+		};
+		mw.success = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.success, 'success', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.success(str);
+				}
+				return tmp;
+			}
+			return mw.alt.success(str);
+		};
+		mw.accent = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.accent, 'accent', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.accent(str);
+				}
+				return tmp;
+			}
+			return mw.alt.accent(str);
+		};
+		mw.signal = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.signal, 'signal', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.signal(str);
+				}
+				return tmp;
+			}
+			return mw.alt.accent(str);
+		};
+		mw.muted = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.muted, 'muted', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.muted(str);
+				}
+				return tmp;
+			}
+			return mw.alt.muted(str);
+		};
+		mw.plain = function (str) {
+			str = String(str);
+			if (mw.enabled && mw.callback) {
+				var tmp = mw.callback(str, mw.main.plain, 'plain', mw.main, mw.alt);
+				if (typeof tmp !== 'string') {
+					return mw.main.plain(str);
+				}
+				return tmp;
+			}
+			return mw.alt.plain(str);
+		};
+		// html encode?
+		mw.wrap = function (str, style) {
+			return '<span class="' + mw.prefix + style + '">' + str + '</span>';
+		};
+		mw.toString = function () {
+			return '<ministyle-peek>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// pull though a stack of styles
+	function stack(items) {
+		var mw = core.base();
+		mw.enabled = true;
+		mw.stack = (isArray(items) ? items : Array.prototype.slice.call(arguments, 0));
+
+		mw.error = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].error(str);
+				}
+			}
+			return str;
+		};
+		mw.warning = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].warning(str);
+				}
+			}
+			return str;
+		};
+		mw.success = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].success(str);
+				}
+			}
+			return str;
+		};
+		mw.accent = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].accent(str);
+				}
+			}
+			return str;
+		};
+		mw.signal = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].signal(str);
+				}
+			}
+			return str;
+		};
+		mw.muted = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].muted(str);
+				}
+			}
+			return str;
+		};
+		mw.plain = function (str) {
+			str = String(str);
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.stack.length; i < ii; i++) {
+					str = mw.stack[i].plain(str);
+				}
+			}
+			return str;
+		};
+		mw.toString = function () {
+			return '<ministyle-stack>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var flow = {
+		stack: stack,
+		toggle: toggle,
+		peek: peek
+	};
+
+	module.exports = flow;
+
+}).call();
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/html.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/html.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/html.js	(revision 487)
@@ -0,0 +1,156 @@
+/*
+
+ ministyle
+
+ https://github.com/Bartvds/ministyle
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003 */
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	//TODO find where we took this and give credit (google/so :)
+	function escapeHTML(html) {
+		return String(html)
+			.replace(/&/g, '&amp;')
+			.replace(/"/g, '&quot;')
+			.replace(/'/g, '&#39;')
+			.replace(/</g, '&lt;')
+			.replace(/>/g, '&gt;');
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	//TODO inline wrap method
+
+	// html output (unsafe)
+	function html(escape) {
+		var mw = core.base();
+
+		mw.error = function (str) {
+			return mw.wrap(str, 'red');
+		};
+		mw.warning = function (str) {
+			return mw.wrap(str, 'yellow');
+		};
+		mw.success = function (str) {
+			return mw.wrap(str, 'green');
+		};
+		mw.accent = function (str) {
+			return mw.wrap(str, 'cyan');
+		};
+		mw.signal = function (str) {
+			return mw.wrap(str, 'magenta');
+		};
+		mw.muted = function (str) {
+			return mw.wrap(str, 'grey');
+		};
+		mw.wrap = function (str, style) {
+			return '<span style="color:' + style + '">' + str + '</span>';
+		};
+		if (escape) {
+			mw.plain = function (str) {
+				return '<span>' + escapeHTML(str) + '</span>';
+			};
+			mw.wrap = function (str, style) {
+				return '<span style="color:' + style + '">' + escapeHTML(str) + '</span>';
+			};
+		} else {
+			mw.plain = function (str) {
+				return '<span>' + escapeHTML(str) + '</span>';
+			};
+			mw.wrap = function (str, style) {
+				return '<span style="color:' + style + '">' + str + '</span>';
+			};
+		}
+		mw.toString = function () {
+			return '<ministyle-html>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// css classes output (unsafe)
+	function css(prefix, escape) {
+		var mw = core.base();
+		mw.prefix = (typeof prefix !== 'undefined' ? prefix : 'mw-');
+		mw.error = function (str) {
+			return mw.wrap(str, 'error');
+		};
+		mw.warning = function (str) {
+			return mw.wrap(str, 'warning');
+		};
+		mw.success = function (str) {
+			return mw.wrap(str, 'success');
+		};
+		mw.accent = function (str) {
+			return mw.wrap(str, 'accent');
+		};
+		mw.signal = function (str) {
+			return mw.wrap(str, 'signal');
+		};
+		mw.muted = function (str) {
+			return mw.wrap(str, 'muted');
+		};
+		mw.plain = function (str) {
+			return mw.wrap(str, 'plain');
+		};
+		// html encode?
+		if (escape) {
+			mw.wrap = function (str, style) {
+				return '<span class="' + mw.prefix + style + '">' + escapeHTML(str) + '</span>';
+			};
+		} else {
+			mw.wrap = function (str, style) {
+				return '<span class="' + mw.prefix + style + '">' + str + '</span>';
+			};
+		}
+		mw.toString = function () {
+			return '<ministyle-css>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var common = {
+		html: html,
+		css: css
+	};
+
+	module.exports = common;
+
+}).call();
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/lib/index.js	(revision 487)
@@ -0,0 +1,56 @@
+/*
+
+ ministyle
+
+ https://github.com/Bartvds/ministyle
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+(function () {
+	'use strict';
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function copy(target, source) {
+		Object.keys(source).forEach(function(key) {
+			target[key] = source[key];
+		});
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var ministyle = {};
+
+	copy(ministyle, require('./core'));
+	copy(ministyle, require('./flow'));
+	copy(ministyle, require('./common'));
+	copy(ministyle, require('./ansi'));
+	copy(ministyle, require('./html'));
+
+	module.exports = ministyle;
+
+}).call();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/ministyle/package.json	(revision 487)
@@ -0,0 +1,57 @@
+{
+  "name": "ministyle",
+  "description": "Minimal chainable semantic output styler/writer",
+  "version": "0.1.3",
+  "homepage": "https://github.com/Bartvds/ministyle",
+  "author": {
+    "name": "Bart van der Schoor",
+    "url": "https://github.com/Bartvds"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/Bartvds/ministyle"
+  },
+  "bugs": {
+    "url": "https://github.com/Bartvds/ministyle/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/Bartvds/ministyle/blob/master/LICENSE-MIT"
+    }
+  ],
+  "keywords": [
+    "cli",
+    "text",
+    "ansi",
+    "color",
+    "stream",
+    "adapter",
+    "style"
+  ],
+  "main": "lib/index.js",
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "grunt": "~0.4.2",
+    "grunt-cli": "~0.1.0",
+    "grunt-mocha-test": "~0.7.0",
+    "mocha-unfunk-reporter": "~0.3.6",
+    "grunt-contrib-clean": "~0.5.0",
+    "grunt-contrib-jshint": "~0.7.2",
+    "jshint-path-reporter": "~0.1.3",
+    "chai": "~1.8.1"
+  },
+  "readme": "ERROR: No README data found!",
+  "_id": "ministyle@0.1.3",
+  "dist": {
+    "shasum": "1a7092efde6a0807e42a7a2901ba4f7174c6585c"
+  },
+  "_from": "ministyle@~0.1.0",
+  "_resolved": "https://registry.npmjs.org/ministyle/-/ministyle-0.1.3.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/LICENSE-MIT
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/LICENSE-MIT	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/LICENSE-MIT	(revision 487)
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Bart van der Schoor
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/README.md	(revision 487)
@@ -0,0 +1,146 @@
+# miniwrite
+
+[![Build Status](https://secure.travis-ci.org/Bartvds/miniwrite.png?branch=master)](http://travis-ci.org/Bartvds/miniwrite) [![Dependency Status](https://gemnasium.com/Bartvds/miniwrite.png)](https://gemnasium.com/Bartvds/miniwrite) [![NPM version](https://badge.fury.io/js/miniwrite.png)](http://badge.fury.io/js/miniwrite)
+
+> Minimal output-stream writer API. 
+
+A pluggable output writer interface/adapter to embed/expose in tools and reporters, also a simplified stream.  
+
+This is not a logging framework or full console or stream replacement. Instead this is an abstraction to build on or expose in other tools. Intend as companion to [ministyle](https://github.com/Bartvds/ministyle) (et al).
+
+## API
+
+Main usage:
+````js
+// simplified node.js.browser compatible console.log()
+var mw = miniwrite.console();
+
+// write plain text line
+mw.writeln('hello world!');
+````
+
+## Helpers
+
+Buffer writes:
+````js
+// buffer own lines
+var mw = miniwrite.buffer();
+// buffer other writes (handy for testing)
+var mw = miniwrite.buffer(myMiniWrite);
+
+// get buffer
+var str = mw.concat();
+var str = mw.concat('\n\n', '\t');
+// iterate buffer if you must
+mw.lines.forEach(function(line) {
+	//..
+})
+// clear buffer
+mw.clear();
+````
+
+Adapter to buffer character writes via `mw.write(chars)`, auto-flushes on newlines:
+````js
+var mw = miniwrite.chars(miniwrite.console());
+
+// write plain text line
+mw.write('hello');
+mw.write(' ');
+mw.writeln('world!'); // "hello world\n"
+
+//or accumulate chars
+mw.write('one');
+mw.write('two');
+mw.flush(true); // onetwo
+
+// clear buffer
+mw.write('one');
+mw.clear();
+mw.write('two');
+mw.flush(true); // two
+
+````
+
+Spread of multiple writers
+````js
+var mw = miniwrite.multi([myANSIConsole, myRemoteSocket, myDiskLogger]);
+mw.enabled = true;
+mw.targets.forEach(function(subw, num) {
+	// .. 
+});
+````
+
+Proxy to toggle stream or swap output target:
+````js
+var mw = miniwrite.peek(myMiniWrite, callback);
+mw.enabled = true;
+mw.target = myOherWrite;
+mw.callback = function(line) {
+	// return string, or false to ignore
+});
+````
+
+Proxy to toggle stream or swap output target:
+````js
+var mw = miniwrite.proxy(myMiniWrite);
+mw.enabled = true;
+mw.target = myOherWrite;
+mw.target = myOherWrite;
+````
+
+Convenience preset for [grunt](https://github.com/gruntjs/grunt) (same as in `grunt ~0.4.1`):
+````js
+var mw = miniwrite.grunt(grunt);
+````
+## Examples
+
+Build your own:
+````js
+var mw = {};
+mw.writeln = function(line) {
+	myWebSocketHyperStream.send({line: line})
+};
+// pass to supporting tools
+awesomeModule.useMiniWritePlz(mw);
+````
+
+Tap into output
+````js
+awesomeModule.writer = miniwrite.splitter([awesomeModule.writer, myMiniWrite]);
+````
+
+## Installation 
+
+```shell
+$ npm install miniwrite --save
+```
+
+## History
+
+* 0.1.2 - Enabled strict mode, split in internal modules
+* 0.1.0 - Extracted styling to [ministyle](https://github.com/Bartvds/ministyle).
+* 0.0.1 - Extracted code from existing projects
+
+## Build
+
+Install development dependencies in your git checkout:
+
+    $ npm install
+
+~Build and run tests:
+
+    $ grunt
+
+See the `Gruntfile.js` for additional commands.
+
+## Contributing
+
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
+
+*Note:* this is an opinionated module: please create a [ticket](https://github.com/Bartvds/miniwrite/issues) to discuss any big ideas. Pull requests for bug fixes are of course always welcome. 
+
+## License
+
+Copyright (c) 2013 Bart van der Schoor
+
+Licensed under the MIT license.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/core.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/core.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/core.js	(revision 487)
@@ -0,0 +1,326 @@
+/*
+
+ miniwrite
+
+ https://github.com/Bartvds/miniwrite
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+//TODO decide how to support monkey patch/mixin
+//TODO freeze some props
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003*/
+
+(function () {
+	'use strict';
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function isArray(obj) {
+		return (Object.prototype.toString.call(obj) === '[object Array]');
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function isMiniWrite(target) {
+		return !!(target && typeof target === 'object' && typeof target.writeln === 'function');
+	}
+
+	function assertMiniWrite(target) {
+		if (!target || !(typeof target === 'object' && typeof target.writeln === 'function')) {
+			throw new Error('target is not a miniwrite: required methods: writeln()');
+		}
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	var miniRoot = {
+		writeln: function (/* line */) {
+			//abstract
+		},
+		toString: function () {
+			return '<miniwrite>';
+		}
+	};
+
+	var miniBase = Object.create(miniRoot);
+
+	function setBase(def) {
+		assertMiniWrite(def);
+		miniBase = def;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function base() {
+		return Object.create(miniBase);
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// allow writing per character, auto flush per line
+	function chars(target, splitExp) {
+		var inst = core.base();
+		inst.textBuffer = '';
+		inst.enabled = true;
+		inst.splitExp = (splitExp || /(.*?)\r?\n/g);
+
+		inst.useTarget = function (target) {
+			inst.target = (target || {
+				// dummy
+				writeln: function () {
+					//nothing
+				}
+			});
+		};
+
+		inst.clear = function () {
+			inst.textBuffer = '';
+			inst.splitExp.lastIndex = 0;
+		};
+
+		inst.write = function (str) {
+			if (str === '') {
+				return;
+			}
+			if (inst.enabled) {
+				//fast path
+				inst.textBuffer += str;
+				inst.flush(true);
+			}
+		};
+
+		inst.writeln = function (str) {
+			if (inst.enabled) {
+				//fast path
+				if (arguments.length === 0) {
+					inst.textBuffer += '\n';
+				}
+				else {
+					inst.textBuffer += str + '\n';
+				}
+				inst.flush(true);
+			}
+		};
+
+		inst.flush = function (linesOnly) {
+			if (inst.textBuffer.length > 0) {
+				var match;
+				var end = 0;
+				//TODO verify if we really need a capture group?
+				//     instead not search for line break and use index + length of match + substing
+				while ((match = inst.splitExp.exec(inst.textBuffer))) {
+					inst.target.writeln(match[1]);
+					end = match.index + (match[0].length || 1);
+					inst.splitExp.lastIndex = end;
+				}
+				if (end > 0) {
+					inst.textBuffer = inst.textBuffer.substring(end);
+					inst.splitExp.lastIndex = 0;
+				}
+				if (!linesOnly && inst.textBuffer.length > 0) {
+					inst.target.writeln(inst.textBuffer);
+					inst.textBuffer = 0;
+					inst.splitExp.lastIndex = 0;
+				}
+			}
+		};
+
+		inst.has = function () {
+			return inst.textBuffer.length > 0;
+		};
+
+		inst.toString = function () {
+			return '<miniwrite-chars>';
+		};
+		// use target
+		inst.useTarget(target);
+		return inst;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// allow writing per character, auto flush per line
+	function splitter(target, splitExp) {
+		var mw = core.base();
+		mw.enabled = true;
+		mw.splitExp = (splitExp || /\r?\n/g);
+		mw.target = target;
+		mw.writeln = function (str) {
+			if (mw.enabled) {
+				str = String(str);
+				var start = 0;
+				var match;
+
+				mw.splitExp.lastIndex = 0;
+				while ((match = mw.splitExp.exec(str))) {
+					var line = str.substring(start, match.index);
+					start = match.index + match[0].length;
+					mw.splitExp.lastIndex = start;
+					mw.target.writeln(line);
+				}
+				// append piece after final linebreak (or final blank line)
+				if (start < str.length || start === str.length) {
+					mw.target.writeln(str.substr(start));
+				}
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-splitter>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// control output
+	function toggle(main, alt) {
+		var mw = core.base();
+		mw.main = main;
+		mw.alt = (alt || function () {
+
+		});
+		mw.active = mw.main;
+		mw.enabled = true;
+		mw.swap = function () {
+			mw.active = (mw.active !== mw.main ? mw.main : mw.alt);
+		};
+		mw.writeln = function (line) {
+			if (!mw.enabled) {
+				return;
+			}
+			if (mw.enabled) {
+				mw.active.writeln(line);
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-toggle>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// call multiple other writers
+	function multi(list /*, ... */) {
+		var mw = core.base();
+		mw.targets = (isArray(list) ? list : Array.prototype.slice.call(arguments.length, 0));
+		mw.enabled = true;
+		mw.writeln = function (line) {
+			if (mw.enabled) {
+				for (var i = 0, ii = mw.targets.length; i < ii; i++) {
+					mw.targets[i].writeln(line);
+				}
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-multi>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// use callback to transform
+	function peek(target, callback) {
+		var mw = core.base();
+		mw.enabled = true;
+		mw.target = target;
+		mw.callback = (callback || function (line /*, mw*/) {
+			return line;
+		});
+		mw.writeln = function (line) {
+			if (mw.enabled && mw.callback) {
+				line = mw.callback(line, mw);
+				if (typeof line === 'string') {
+					mw.target.writeln(line);
+				}
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-peek>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// to extract as string (can wrap others)
+	function buffer(patch) {
+		var mw = (patch || core.base());
+		mw.lines = [];
+		mw.enabled = true;
+		mw.writeln = function (line) {
+			if (mw.enabled) {
+				mw.lines.push(String(line));
+			}
+		};
+		//TODO add wordwrap?
+		mw.concat = function (seperator, indent, sepAfter) {
+			if (mw.lines.length > 0) {
+				sepAfter = (typeof sepAfter !== 'undefined' ? sepAfter : true);
+				seperator = (typeof seperator !== 'undefined' ? seperator : '\n');
+				indent = (typeof indent !== 'undefined' ? indent : '');
+				return indent + mw.lines.join(seperator + indent) + (sepAfter ? seperator : '');
+			}
+			return '';
+		};
+		mw.clear = function () {
+			mw.lines.length = 0;
+		};
+		if (!patch) {
+			mw.toString = function () {
+				return '<miniwrite-buffer>';
+			};
+		}
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var core = {
+		assertMiniWrite: assertMiniWrite,
+		isMiniWrite: isMiniWrite,
+
+		setBase: setBase,
+
+		base: base,
+		chars: chars,
+		buffer: buffer,
+		splitter: splitter,
+
+		toggle: toggle,
+		multi: multi,
+		peek: peek
+	};
+
+	module.exports = core;
+
+}).call();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/html.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/html.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/html.js	(revision 487)
@@ -0,0 +1,145 @@
+/*
+
+ miniwrite
+
+ https://github.com/Bartvds/miniwrite
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function getAttributes(attributes) {
+		var t = typeof attributes;
+		if (t === 'string') {
+			return attributes;
+		}
+		if (t === 'object') {
+			return Object.keys(attributes).reduce(function (memo, key) {
+				memo.push(key + '="' + attributes[key] + '"');
+				return memo;
+			}, []).join(' ');
+		}
+		return '';
+	}
+
+	function getHTMLWrap(tag, attributes, linebreak) {
+		tag = (tag || 'span');
+		attributes = getAttributes(attributes);
+		linebreak = (typeof linebreak !== 'undefined' ? linebreak : '\n');
+
+		var pre = '<' + tag + (attributes.length > 0 ? ' ' + attributes : '') + '>';
+		var post = '</' + tag + '>' + linebreak;
+
+		return function (str) {
+			return pre + str + post;
+		};
+	}
+
+	function getHTMLSpanWrap() {
+		return getHTMLWrap('span', 'style="white-space:pre;font-family:monospace;"', '\n');
+	}
+
+	function getHTMLDomAppend(tag, attributes) {
+		tag = (tag || 'span');
+		attributes = getAttributes(attributes);
+
+		var keys = Object.keys(attributes);
+		if (keys.length === 0) {
+			return function (str) {
+				var elem = document.createElement(tag);
+				elem.appendChild(document.createTextNode(str));
+				return elem;
+			};
+		}
+
+		return function (str) {
+			var elem = document.createElement(tag);
+			elem.appendChild(document.createTextNode(str));
+			for (var i = 0, ii = keys.length; i < ii; i++) {
+				var atr = document.createAttribute(keys[i]);
+				atr.nodeValue = attributes[keys[i]];
+				elem.setAttributeNode(atr);
+			}
+			return elem;
+		};
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function htmlString(target, tag, attributes, linebreak) {
+		var wrap = getHTMLWrap((tag || 'span'), (attributes || {style: 'white-space:pre;font-family:monospace;'}), linebreak);
+		var mw = core.base();
+		mw.enabled = true;
+		mw.target = target;
+		mw.writeln = function (line) {
+			if (mw.enabled) {
+				mw.target.writeln(wrap(line));
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-html-string>';
+		};
+		return mw;
+	}
+
+	function htmlAppend(parent, tag, attributes) {
+		var wrap = getHTMLDomAppend((tag || 'span'), (attributes || {style: 'white-space:pre;font-family:monospace;'}));
+		var mw = core.base();
+		mw.enabled = true;
+		mw.parent = parent;
+		mw.writeln = function (line) {
+			if (mw.enabled) {
+				mw.parent.appendChild(wrap(line));
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-html-append>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var html = {
+		getHTMLWrap: getHTMLWrap,
+		getHTMLSpanWrap: getHTMLSpanWrap,
+		getHTMLDomAppend: getHTMLDomAppend,
+
+		htmlString: htmlString,
+		htmlAppend: htmlAppend
+	};
+
+	module.exports = html;
+
+}).call();
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/index.js	(revision 487)
@@ -0,0 +1,56 @@
+/*
+
+ miniwrite
+
+ https://github.com/Bartvds/miniwrite
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+(function () {
+	'use strict';
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function copy(target, source) {
+		Object.keys(source).forEach(function(key) {
+			target[key] = source[key];
+		});
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var miniwrite = {};
+
+	copy(miniwrite, require('./io'));
+	copy(miniwrite, require('./log'));
+	copy(miniwrite, require('./html'));
+	copy(miniwrite, require('./core'));
+
+	module.exports = miniwrite;
+
+}).call();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/io.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/io.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/io.js	(revision 487)
@@ -0,0 +1,204 @@
+/*
+
+ miniwrite
+
+ https://github.com/Bartvds/miniwrite
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+	var mkdirp = require('mkdirp');
+	var path = require('path');
+	var fs = require('fs');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// node.js stream
+	function stream(nodeStream, linebreak) {
+		var mw = core.base();
+		mw.enabled = true;
+		mw.stream = nodeStream;
+		mw.linebreak = (typeof linebreak !== 'undefined' ? linebreak : '\n');
+		mw.writeln = function (line) {
+			if (mw.enabled) {
+				mw.stream.write(line + linebreak);
+			}
+		};
+		mw.toString = function () {
+			return '<miniwrite-stream>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// node.js file stream
+	//TODO add auto close?
+	//TODO this is buggy: won't flush on exit()
+	function disk(file, linebreak) {
+		var mw = core.base();
+		mw.linebreak = (typeof linebreak !== 'undefined' ? linebreak : '\n');
+		mw.enabled = true;
+		mw.file = file;
+		var stream;
+		var start = 0;
+		var buffer = core.buffer();
+		var streaming = {
+			writeln: function (line) {
+				var buff = new Buffer(line + mw.linebreak, 'utf8');
+				start += buff.length;
+				stream.write(buff);
+			}
+		};
+		var active = buffer;
+		var splitter = core.splitter({
+			writeln: function (line) {
+				active.writeln(line);
+			}
+		});
+
+		var opening = false;
+		var initing = false;
+		(function () {
+			initing = true;
+			function finalKill(err) {
+				initing = false;
+				if (err) {
+					console.log(err);
+					return;
+				}
+				// auto start
+				start = 0;
+				if (buffer.lines.length > 0) {
+					open(mw.file);
+					return;
+				}
+				// and done already
+				if (flushCallback.length > 0) {
+					doFlush();
+				}
+			}
+
+			fs.exists(mw.file, function (exists) {
+				if (!exists) {
+					finalKill();
+					return;
+				}
+				fs.truncate(mw.file, 0, finalKill);
+			});
+		}());
+
+		function open(dest) {
+			if (!stream && !opening) {
+				opening = true;
+				mkdirp(path.dirname(dest), function (err) {
+					/*jshint -W115 */
+					opening = false;
+					if (err) {
+						console.log(err);
+						return;
+					}
+					stream = fs.createWriteStream(dest, {
+						start: start,
+						flags: (start === 0 ? 'w' : 'a'),
+						encoding: 'utf8',
+						mode: '0644'
+					});
+					active = streaming;
+					//flush buffer
+					buffer.lines.forEach(function (line) {
+						active.writeln(line);
+					});
+					buffer.clear();
+
+					// and done already
+					if (flushCallback.length > 0) {
+						doFlush();
+					}
+				});
+			}
+		}
+
+		mw.writeln = function (line) {
+			//console.log('writeln >' + line + '<');
+			if (mw.enabled) {
+				if (!stream) {
+					open(mw.file);
+				}
+				splitter.writeln(line);
+			}
+		};
+
+		var flushCallback = [];
+
+		function doFlush() {
+			if (initing || opening) {
+				return;
+			}
+			active = buffer;
+			var callbackList = flushCallback;
+			flushCallback = [];
+			if (stream) {
+				stream.on('finish', function () {
+					callbackList.forEach(function (callback) {
+						callback(mw);
+					});
+				});
+				stream.end();
+				stream = null;
+				return;
+			}
+			process.nextTick(function () {
+				callbackList.forEach(function (callback) {
+					callback(mw);
+				});
+			});
+		}
+
+		mw.flush = function (callback) {
+			flushCallback.push(callback);
+			doFlush();
+		};
+		mw.toString = function () {
+			return '<miniwrite-stream>';
+		};
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var io = {
+		stream: stream,
+		disk: disk
+	};
+	module.exports = io;
+
+}).call();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/log.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/log.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/lib/log.js	(revision 487)
@@ -0,0 +1,110 @@
+/*
+
+ miniwrite
+
+ https://github.com/Bartvds/miniwrite
+
+ Copyright (c) 2013 Bart van der Schoor
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation
+ files (the "Software"), to deal in the Software without
+ restriction, including without limitation the rights to use,
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following
+ conditions:
+
+ The above copyright notice and this permission notice shall be
+ included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+//TODO decide how to support monkey patch/mixin
+//TODO freeze some props
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+/*jshint -W003*/
+
+(function () {
+	'use strict';
+
+	var core = require('./core');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// node.js / browser console.log
+	function log(patch) {
+		var mw = (patch || core.base());
+		mw.enabled = true;
+		// let's be gentle
+		if (console) {
+			mw.writeln = function (str) {
+				if (mw.enabled) {
+					console.log(String(str));
+				}
+			};
+		}
+		else {
+			mw.writeln = function (/*str*/) {
+				// ignore?
+			};
+		}
+		if (!patch) {
+			mw.toString = function () {
+				return '<miniwrite-log>';
+			};
+		}
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// grunt lazy
+	function grunt(gruntInst, verbose, patch) {
+		var mw = (patch || core.base());
+		mw.enabled = true;
+		if (verbose) {
+			mw.writeln = function (line) {
+				if (mw.enabled) {
+					gruntInst.verbose.writeln(line);
+				}
+			};
+		}
+		else {
+			mw.writeln = function (line) {
+				if (mw.enabled) {
+					gruntInst.log.writeln(line);
+				}
+			};
+		}
+		if (!patch) {
+			mw.toString = function () {
+				return '<miniwrite-grunt>';
+			};
+		}
+		return mw;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// assemble exports
+	var logio = {
+		log: log,
+		grunt: grunt
+	};
+
+	module.exports = logio;
+
+}).call();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/.npmignore	(revision 487)
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/.travis.yml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/.travis.yml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/.travis.yml	(revision 487)
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+  - 0.6
+  - 0.8
+  - 0.9
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/LICENSE	(revision 487)
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/examples/pow.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/examples/pow.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/examples/pow.js	(revision 487)
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/index.js	(revision 487)
@@ -0,0 +1,82 @@
+var path = require('path');
+var fs = require('fs');
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, mode, f, made) {
+    if (typeof mode === 'function' || mode === undefined) {
+        f = mode;
+        mode = 0777 & (~process.umask());
+    }
+    if (!made) made = null;
+
+    var cb = f || function () {};
+    if (typeof mode === 'string') mode = parseInt(mode, 8);
+    p = path.resolve(p);
+
+    fs.mkdir(p, mode, function (er) {
+        if (!er) {
+            made = made || p;
+            return cb(null, made);
+        }
+        switch (er.code) {
+            case 'ENOENT':
+                mkdirP(path.dirname(p), mode, function (er, made) {
+                    if (er) cb(er, made);
+                    else mkdirP(p, mode, cb, made);
+                });
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                fs.stat(p, function (er2, stat) {
+                    // if the stat fails, then that's super weird.
+                    // let the original error be the failure reason.
+                    if (er2 || !stat.isDirectory()) cb(er, made)
+                    else cb(null, made);
+                });
+                break;
+        }
+    });
+}
+
+mkdirP.sync = function sync (p, mode, made) {
+    if (mode === undefined) {
+        mode = 0777 & (~process.umask());
+    }
+    if (!made) made = null;
+
+    if (typeof mode === 'string') mode = parseInt(mode, 8);
+    p = path.resolve(p);
+
+    try {
+        fs.mkdirSync(p, mode);
+        made = made || p;
+    }
+    catch (err0) {
+        switch (err0.code) {
+            case 'ENOENT' :
+                made = sync(path.dirname(p), mode, made);
+                sync(p, mode, made);
+                break;
+
+            // In the case of any other error, just see if there's a dir
+            // there already.  If so, then hooray!  If not, then something
+            // is borked.
+            default:
+                var stat;
+                try {
+                    stat = fs.statSync(p);
+                }
+                catch (err1) {
+                    throw err0;
+                }
+                if (!stat.isDirectory()) throw err0;
+                break;
+        }
+    }
+
+    return made;
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/package.json	(revision 487)
@@ -0,0 +1,34 @@
+{
+  "name": "mkdirp",
+  "description": "Recursively mkdir, like `mkdir -p`",
+  "version": "0.3.5",
+  "author": {
+    "name": "James Halliday",
+    "email": "mail@substack.net",
+    "url": "http://substack.net"
+  },
+  "main": "./index",
+  "keywords": [
+    "mkdir",
+    "directory"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "http://github.com/substack/node-mkdirp.git"
+  },
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "devDependencies": {
+    "tap": "~0.4.0"
+  },
+  "license": "MIT",
+  "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n    \nmkdirp('/tmp/foo/bar/baz', function (err) {\n    if (err) console.error(err)\n    else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n",
+  "readmeFilename": "readme.markdown",
+  "bugs": {
+    "url": "https://github.com/substack/node-mkdirp/issues"
+  },
+  "homepage": "https://github.com/substack/node-mkdirp",
+  "_id": "mkdirp@0.3.5",
+  "_from": "mkdirp@~0.3.5"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/readme.markdown
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/readme.markdown	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/readme.markdown	(revision 487)
@@ -0,0 +1,63 @@
+# mkdirp
+
+Like `mkdir -p`, but in node.js!
+
+[![build status](https://secure.travis-ci.org/substack/node-mkdirp.png)](http://travis-ci.org/substack/node-mkdirp)
+
+# example
+
+## pow.js
+
+```js
+var mkdirp = require('mkdirp');
+    
+mkdirp('/tmp/foo/bar/baz', function (err) {
+    if (err) console.error(err)
+    else console.log('pow!')
+});
+```
+
+Output
+
+```
+pow!
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+var mkdirp = require('mkdirp');
+```
+
+## mkdirp(dir, mode, cb)
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+`cb(err, made)` fires with the error or the first directory `made`
+that had to be created, if any.
+
+## mkdirp.sync(dir, mode)
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+Returns the first directory that had to be created, if any.
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+# license
+
+MIT
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/chmod.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/chmod.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/chmod.js	(revision 487)
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+    var mode = 0744
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
+            t.end();
+        });
+    });
+});
+
+test('chmod', function (t) {
+    var mode = 0755
+    mkdirp(file, mode, function (er) {
+        t.ifError(er, 'should not error');
+        fs.stat(file, function (er, stat) {
+            t.ifError(er, 'should exist');
+            t.ok(stat && stat.isDirectory(), 'should be directory');
+            t.end();
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/clobber.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/clobber.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/clobber.js	(revision 487)
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+    var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+    console.error("about to write to "+itw)
+    fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+    fs.stat(itw, function (er, stat) {
+        t.ifError(er)
+        t.ok(stat && stat.isFile(), 'should be file')
+        t.end()
+    })
+})
+
+test('clobber', function (t) {
+    t.plan(2);
+    mkdirp(file, 0755, function (err) {
+        t.ok(err);
+        t.equal(err.code, 'ENOTDIR');
+        t.end();
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/mkdirp.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/mkdirp.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/mkdirp.js	(revision 487)
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('woo', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, 0755, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    t.equal(stat.mode & 0777, 0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/perm.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/perm.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/perm.js	(revision 487)
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('async perm', function (t) {
+    t.plan(2);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+    
+    mkdirp(file, 0755, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    t.equal(stat.mode & 0777, 0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});
+
+test('async root perm', function (t) {
+    mkdirp('/tmp', 0755, function (err) {
+        if (err) t.fail(err);
+        t.end();
+    });
+    t.end();
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/perm_sync.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/perm_sync.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/perm_sync.js	(revision 487)
@@ -0,0 +1,39 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync perm', function (t) {
+    t.plan(2);
+    var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+    
+    mkdirp.sync(file, 0755);
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.equal(stat.mode & 0777, 0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        })
+    });
+});
+
+test('sync root perm', function (t) {
+    t.plan(1);
+    
+    var file = '/tmp';
+    mkdirp.sync(file, 0755);
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        })
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/race.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/race.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/race.js	(revision 487)
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('race', function (t) {
+    t.plan(4);
+    var ps = [ '', 'tmp' ];
+    
+    for (var i = 0; i < 25; i++) {
+        var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+        ps.push(dir);
+    }
+    var file = ps.join('/');
+    
+    var res = 2;
+    mk(file, function () {
+        if (--res === 0) t.end();
+    });
+    
+    mk(file, function () {
+        if (--res === 0) t.end();
+    });
+    
+    function mk (file, cb) {
+        mkdirp(file, 0755, function (err) {
+            if (err) t.fail(err);
+            else path.exists(file, function (ex) {
+                if (!ex) t.fail('file not created')
+                else fs.stat(file, function (err, stat) {
+                    if (err) t.fail(err)
+                    else {
+                        t.equal(stat.mode & 0777, 0755);
+                        t.ok(stat.isDirectory(), 'target not a directory');
+                        if (cb) cb();
+                    }
+                })
+            })
+        });
+    }
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/rel.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/rel.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/rel.js	(revision 487)
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('rel', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var cwd = process.cwd();
+    process.chdir('/tmp');
+    
+    var file = [x,y,z].join('/');
+    
+    mkdirp(file, 0755, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    process.chdir(cwd);
+                    t.equal(stat.mode & 0777, 0755);
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/return.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/return.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/return.js	(revision 487)
@@ -0,0 +1,25 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(4);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    mkdirp(file, function (err, made) {
+        t.ifError(err);
+        t.equal(made, '/tmp/' + x);
+        mkdirp(file, function (err, made) {
+          t.ifError(err);
+          t.equal(made, null);
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/return_sync.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/return_sync.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/return_sync.js	(revision 487)
@@ -0,0 +1,24 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    // should return the first dir created.
+    // By this point, it would be profoundly surprising if /tmp didn't
+    // already exist, since every other test makes things in there.
+    // Note that this will throw on failure, which will fail the test.
+    var made = mkdirp.sync(file);
+    t.equal(made, '/tmp/' + x);
+
+    // making the same file again should have no effect.
+    made = mkdirp.sync(file);
+    t.equal(made, null);
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/root.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/root.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/root.js	(revision 487)
@@ -0,0 +1,18 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('root', function (t) {
+    // '/' on unix, 'c:/' on windows.
+    var file = path.resolve('/');
+
+    mkdirp(file, 0755, function (err) {
+        if (err) throw err
+        fs.stat(file, function (er, stat) {
+            if (er) throw er
+            t.ok(stat.isDirectory(), 'target is a directory');
+            t.end();
+        })
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/sync.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/sync.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/sync.js	(revision 487)
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file, 0755);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.equal(stat.mode & 0777, 0755);
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/umask.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/umask.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/umask.js	(revision 487)
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('implicit mode from umask', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    
+    var file = '/tmp/' + [x,y,z].join('/');
+    
+    mkdirp(file, function (err) {
+        if (err) t.fail(err);
+        else path.exists(file, function (ex) {
+            if (!ex) t.fail('file not created')
+            else fs.stat(file, function (err, stat) {
+                if (err) t.fail(err)
+                else {
+                    t.equal(stat.mode & 0777, 0777 & (~process.umask()));
+                    t.ok(stat.isDirectory(), 'target not a directory');
+                    t.end();
+                }
+            })
+        })
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/umask_sync.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/umask_sync.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/node_modules/mkdirp/test/umask_sync.js	(revision 487)
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('umask sync modes', function (t) {
+    t.plan(2);
+    var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+    var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+    var file = '/tmp/' + [x,y,z].join('/');
+
+    try {
+        mkdirp.sync(file);
+    } catch (err) {
+        t.fail(err);
+        return t.end();
+    }
+
+    path.exists(file, function (ex) {
+        if (!ex) t.fail('file not created')
+        else fs.stat(file, function (err, stat) {
+            if (err) t.fail(err)
+            else {
+                t.equal(stat.mode & 0777, (0777 & (~process.umask())));
+                t.ok(stat.isDirectory(), 'target not a directory');
+                t.end();
+            }
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/miniwrite/package.json	(revision 487)
@@ -0,0 +1,60 @@
+{
+  "name": "miniwrite",
+  "description": "Minimal semantic output writer",
+  "version": "0.1.3",
+  "homepage": "https://github.com/Bartvds/miniwrite",
+  "author": {
+    "name": "Bart van der Schoor",
+    "url": "https://github.com/Bartvds"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/Bartvds/miniwrite"
+  },
+  "bugs": {
+    "url": "https://github.com/Bartvds/miniwrite/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/Bartvds/miniwrite/blob/master/LICENSE-MIT"
+    }
+  ],
+  "keywords": [
+    "cli",
+    "ansi",
+    "text",
+    "color",
+    "stream",
+    "adapter",
+    "writer"
+  ],
+  "main": "lib/",
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "dependencies": {
+    "mkdirp": "~0.3.5"
+  },
+  "devDependencies": {
+    "grunt": "~0.4.2",
+    "grunt-cli": "~0.1.0",
+    "grunt-mocha-test": "~0.7.0",
+    "mocha-unfunk-reporter": "~0.3.7",
+    "grunt-contrib-clean": "~0.5.0",
+    "grunt-contrib-jshint": "~0.7.2",
+    "jshint-path-reporter": "~0.1.3",
+    "chai": "~1.8.1"
+  },
+  "readme": "# miniwrite\n\n[![Build Status](https://secure.travis-ci.org/Bartvds/miniwrite.png?branch=master)](http://travis-ci.org/Bartvds/miniwrite) [![Dependency Status](https://gemnasium.com/Bartvds/miniwrite.png)](https://gemnasium.com/Bartvds/miniwrite) [![NPM version](https://badge.fury.io/js/miniwrite.png)](http://badge.fury.io/js/miniwrite)\n\n> Minimal output-stream writer API. \n\nA pluggable output writer interface/adapter to embed/expose in tools and reporters, also a simplified stream.  \n\nThis is not a logging framework or full console or stream replacement. Instead this is an abstraction to build on or expose in other tools. Intend as companion to [ministyle](https://github.com/Bartvds/ministyle) (et al).\n\n## API\n\nMain usage:\n````js\n// simplified node.js.browser compatible console.log()\nvar mw = miniwrite.console();\n\n// write plain text line\nmw.writeln('hello world!');\n````\n\n## Helpers\n\nBuffer writes:\n````js\n// buffer own lines\nvar mw = miniwrite.buffer();\n// buffer other writes (handy for testing)\nvar mw = miniwrite.buffer(myMiniWrite);\n\n// get buffer\nvar str = mw.concat();\nvar str = mw.concat('\\n\\n', '\\t');\n// iterate buffer if you must\nmw.lines.forEach(function(line) {\n\t//..\n})\n// clear buffer\nmw.clear();\n````\n\nAdapter to buffer character writes via `mw.write(chars)`, auto-flushes on newlines:\n````js\nvar mw = miniwrite.chars(miniwrite.console());\n\n// write plain text line\nmw.write('hello');\nmw.write(' ');\nmw.writeln('world!'); // \"hello world\\n\"\n\n//or accumulate chars\nmw.write('one');\nmw.write('two');\nmw.flush(true); // onetwo\n\n// clear buffer\nmw.write('one');\nmw.clear();\nmw.write('two');\nmw.flush(true); // two\n\n````\n\nSpread of multiple writers\n````js\nvar mw = miniwrite.multi([myANSIConsole, myRemoteSocket, myDiskLogger]);\nmw.enabled = true;\nmw.targets.forEach(function(subw, num) {\n\t// .. \n});\n````\n\nProxy to toggle stream or swap output target:\n````js\nvar mw = miniwrite.peek(myMiniWrite, callback);\nmw.enabled = true;\nmw.target = myOherWrite;\nmw.callback = function(line) {\n\t// return string, or false to ignore\n});\n````\n\nProxy to toggle stream or swap output target:\n````js\nvar mw = miniwrite.proxy(myMiniWrite);\nmw.enabled = true;\nmw.target = myOherWrite;\nmw.target = myOherWrite;\n````\n\nConvenience preset for [grunt](https://github.com/gruntjs/grunt) (same as in `grunt ~0.4.1`):\n````js\nvar mw = miniwrite.grunt(grunt);\n````\n## Examples\n\nBuild your own:\n````js\nvar mw = {};\nmw.writeln = function(line) {\n\tmyWebSocketHyperStream.send({line: line})\n};\n// pass to supporting tools\nawesomeModule.useMiniWritePlz(mw);\n````\n\nTap into output\n````js\nawesomeModule.writer = miniwrite.splitter([awesomeModule.writer, myMiniWrite]);\n````\n\n## Installation \n\n```shell\n$ npm install miniwrite --save\n```\n\n## History\n\n* 0.1.2 - Enabled strict mode, split in internal modules\n* 0.1.0 - Extracted styling to [ministyle](https://github.com/Bartvds/ministyle).\n* 0.0.1 - Extracted code from existing projects\n\n## Build\n\nInstall development dependencies in your git checkout:\n\n    $ npm install\n\n~Build and run tests:\n\n    $ grunt\n\nSee the `Gruntfile.js` for additional commands.\n\n## Contributing\n\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\n\n*Note:* this is an opinionated module: please create a [ticket](https://github.com/Bartvds/miniwrite/issues) to discuss any big ideas. Pull requests for bug fixes are of course always welcome. \n\n## License\n\nCopyright (c) 2013 Bart van der Schoor\n\nLicensed under the MIT license.",
+  "readmeFilename": "README.md",
+  "_id": "miniwrite@0.1.3",
+  "dist": {
+    "shasum": "a88acfef4a7056923d33f5e1ee3ff38260f1586b"
+  },
+  "_from": "miniwrite@~0.1.0",
+  "_resolved": "https://registry.npmjs.org/miniwrite/-/miniwrite-0.1.3.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/.npmignore	(revision 487)
@@ -0,0 +1,1 @@
+node_modules
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/LICENSE	(revision 487)
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/README.md	(revision 487)
@@ -0,0 +1,344 @@
+# Request -- Simplified HTTP request method
+
+## Install
+
+<pre>
+  npm install request
+</pre>
+
+Or from source:
+
+<pre>
+  git clone git://github.com/mikeal/request.git 
+  cd request
+  npm link
+</pre>
+
+## Super simple to use
+
+Request is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.
+
+```javascript
+var request = require('request');
+request('http://www.google.com', function (error, response, body) {
+  if (!error && response.statusCode == 200) {
+    console.log(body) // Print the google web page.
+  }
+})
+```
+
+## Streaming
+
+You can stream any response to a file stream.
+
+```javascript
+request('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))
+```
+
+You can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.
+
+```javascript
+fs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))
+```
+
+Request can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.
+
+```javascript
+request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))
+```
+
+Now let's get fancy.
+
+```javascript
+http.createServer(function (req, resp) {
+  if (req.url === '/doodle.png') {
+    if (req.method === 'PUT') {
+      req.pipe(request.put('http://mysite.com/doodle.png'))
+    } else if (req.method === 'GET' || req.method === 'HEAD') {
+      request.get('http://mysite.com/doodle.png').pipe(resp)
+    } 
+  }
+})
+```
+
+You can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:
+
+```javascript
+http.createServer(function (req, resp) {
+  if (req.url === '/doodle.png') {
+    var x = request('http://mysite.com/doodle.png')
+    req.pipe(x)
+    x.pipe(resp)
+  }
+})
+```
+
+And since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)
+
+```javascript
+req.pipe(request('http://mysite.com/doodle.png')).pipe(resp)
+```
+
+Also, none of this new functionality conflicts with requests previous features, it just expands them.
+
+```javascript
+var r = request.defaults({'proxy':'http://localproxy.com'})
+
+http.createServer(function (req, resp) {
+  if (req.url === '/doodle.png') {
+    r.get('http://google.com/doodle.png').pipe(resp)
+  }
+})
+```
+You can still use intermediate proxies, the requests will still follow HTTP forwards, etc.
+
+## Forms
+
+`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.
+
+Url encoded forms are simple
+
+```javascript
+request.post('http://service.com/upload', {form:{key:'value'}})
+// or
+request.post('http://service.com/upload').form({key:'value'})
+```
+
+For `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.
+
+```javascript
+var r = request.post('http://service.com/upload')
+var form = r.form()
+form.append('my_field', 'my_value')
+form.append('my_buffer', new Buffer([1, 2, 3]))
+form.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))
+form.append('remote_file', request('http://google.com/doodle.png'))
+```
+
+## HTTP Authentication
+
+```javascript
+request.get('http://some.server.com/').auth('username', 'password', false);
+// or
+request.get('http://some.server.com/', {
+  'auth': {
+    'user': 'username',
+    'pass': 'password',
+    'sendImmediately': false
+  }
+});
+```
+
+If passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional).  The method form takes parameters `auth(username, password, sendImmediately)`.
+
+`sendImmediately` defaults to true, which will cause a basic authentication header to be sent.  If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).
+
+Digest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).
+
+## OAuth Signing
+
+```javascript
+// Twitter OAuth
+var qs = require('querystring')
+  , oauth =
+    { callback: 'http://mysite.com/callback/'
+    , consumer_key: CONSUMER_KEY
+    , consumer_secret: CONSUMER_SECRET
+    }
+  , url = 'https://api.twitter.com/oauth/request_token'
+  ;
+request.post({url:url, oauth:oauth}, function (e, r, body) {
+  // Ideally, you would take the body in the response
+  // and construct a URL that a user clicks on (like a sign in button).
+  // The verifier is only available in the response after a user has 
+  // verified with twitter that they are authorizing your app.
+  var access_token = qs.parse(body)
+    , oauth = 
+      { consumer_key: CONSUMER_KEY
+      , consumer_secret: CONSUMER_SECRET
+      , token: access_token.oauth_token
+      , verifier: access_token.oauth_verifier
+      }
+    , url = 'https://api.twitter.com/oauth/access_token'
+    ;
+  request.post({url:url, oauth:oauth}, function (e, r, body) {
+    var perm_token = qs.parse(body)
+      , oauth = 
+        { consumer_key: CONSUMER_KEY
+        , consumer_secret: CONSUMER_SECRET
+        , token: perm_token.oauth_token
+        , token_secret: perm_token.oauth_token_secret
+        }
+      , url = 'https://api.twitter.com/1/users/show.json?'
+      , params = 
+        { screen_name: perm_token.screen_name
+        , user_id: perm_token.user_id
+        }
+      ;
+    url += qs.stringify(params)
+    request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {
+      console.log(user)
+    })
+  })
+})
+```
+
+
+
+### request(options, callback)
+
+The first argument can be either a url or an options object. The only required option is uri, all others are optional.
+
+* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()
+* `qs` - object containing querystring values to be appended to the uri
+* `method` - http method, defaults to GET
+* `headers` - http headers, defaults to {}
+* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string.
+* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.
+* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional).  See documentation above.
+* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header.  Additionally, parses the response body as json.
+* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.
+* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.
+* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.
+* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.
+* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.
+* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.
+* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.
+* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request	
+* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.
+* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.
+* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).
+* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.
+* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section)
+* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)
+* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.
+* `localAddress` - Local interface to bind for network connections.
+
+
+The callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer.
+
+## Convenience methods
+
+There are also shorthand methods for different HTTP METHODs and some other conveniences.
+
+### request.defaults(options)  
+  
+This method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.
+
+### request.put
+
+Same as request() but defaults to `method: "PUT"`.
+
+```javascript
+request.put(url)
+```
+
+### request.patch
+
+Same as request() but defaults to `method: "PATCH"`.
+
+```javascript
+request.patch(url)
+```
+
+### request.post
+
+Same as request() but defaults to `method: "POST"`.
+
+```javascript
+request.post(url)
+```
+
+### request.head
+
+Same as request() but defaults to `method: "HEAD"`.
+
+```javascript
+request.head(url)
+```
+
+### request.del
+
+Same as request() but defaults to `method: "DELETE"`.
+
+```javascript
+request.del(url)
+```
+
+### request.get
+
+Alias to normal request method for uniformity.
+
+```javascript
+request.get(url)
+```
+### request.cookie
+
+Function that creates a new cookie.
+
+```javascript
+request.cookie('cookie_string_here')
+```
+### request.jar
+
+Function that creates a new cookie jar.
+
+```javascript
+request.jar()
+```
+
+
+## Examples:
+
+```javascript
+  var request = require('request')
+    , rand = Math.floor(Math.random()*100000000).toString()
+    ;
+  request(
+    { method: 'PUT'
+    , uri: 'http://mikeal.iriscouch.com/testjs/' + rand
+    , multipart: 
+      [ { 'content-type': 'application/json'
+        ,  body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})
+        }
+      , { body: 'I am an attachment' }
+      ] 
+    }
+  , function (error, response, body) {
+      if(response.statusCode == 201){
+        console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)
+      } else {
+        console.log('error: '+ response.statusCode)
+        console.log(body)
+      }
+    }
+  )
+```
+Cookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent).
+
+```javascript
+var request = request.defaults({jar: true})
+request('http://www.google.com', function () {
+  request('http://images.google.com')
+})
+```
+
+If you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:
+
+```javascript
+var j = request.jar()
+var request = request.defaults({jar:j})
+request('http://www.google.com', function () {
+  request('http://images.google.com')
+})
+```
+OR
+
+```javascript
+var j = request.jar()
+var cookie = request.cookie('your_cookie_here')
+j.add(cookie)
+request({url: 'http://www.google.com', jar: j}, function () {
+  request('http://images.google.com')
+})
+```
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/index.js	(revision 487)
@@ -0,0 +1,1392 @@
+// Copyright 2010-2012 Mikeal Rogers
+//
+//    Licensed under the Apache License, Version 2.0 (the "License");
+//    you may not use this file except in compliance with the License.
+//    You may obtain a copy of the License at
+//
+//        http://www.apache.org/licenses/LICENSE-2.0
+//
+//    Unless required by applicable law or agreed to in writing, software
+//    distributed under the License is distributed on an "AS IS" BASIS,
+//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//    See the License for the specific language governing permissions and
+//    limitations under the License.
+
+var http = require('http')
+  , https = false
+  , tls = false
+  , url = require('url')
+  , util = require('util')
+  , stream = require('stream')
+  , qs = require('qs')
+  , querystring = require('querystring')
+  , crypto = require('crypto')
+
+  , oauth = require('oauth-sign')
+  , hawk = require('hawk')
+  , aws = require('aws-sign')
+  , httpSignature = require('http-signature')
+  , uuid = require('node-uuid')
+  , mime = require('mime')
+  , tunnel = require('tunnel-agent')
+  , safeStringify = require('json-stringify-safe')
+
+  , ForeverAgent = require('forever-agent')
+  , FormData = require('form-data')
+
+  , Cookie = require('cookie-jar')
+  , CookieJar = Cookie.Jar
+  , cookieJar = new CookieJar
+  ;
+
+try {
+  https = require('https')
+} catch (e) {}
+
+try {
+  tls = require('tls')
+} catch (e) {}
+
+var debug
+if (/\brequest\b/.test(process.env.NODE_DEBUG)) {
+  debug = function() {
+    console.error('REQUEST %s', util.format.apply(util, arguments))
+  }
+} else {
+  debug = function() {}
+}
+
+function toBase64 (str) {
+  return (new Buffer(str || "", "ascii")).toString("base64")
+}
+
+function md5 (str) {
+  return crypto.createHash('md5').update(str).digest('hex')
+}
+
+// Hacky fix for pre-0.4.4 https
+if (https && !https.Agent) {
+  https.Agent = function (options) {
+    http.Agent.call(this, options)
+  }
+  util.inherits(https.Agent, http.Agent)
+  https.Agent.prototype._getConnection = function (host, port, cb) {
+    var s = tls.connect(port, host, this.options, function () {
+      // do other checks here?
+      if (cb) cb()
+    })
+    return s
+  }
+}
+
+function isReadStream (rs) {
+  if (rs.readable && rs.path && rs.mode) {
+    return true
+  }
+}
+
+function copy (obj) {
+  var o = {}
+  Object.keys(obj).forEach(function (i) {
+    o[i] = obj[i]
+  })
+  return o
+}
+
+var isUrl = /^https?:/
+
+var globalPool = {}
+
+function Request (options) {
+  stream.Stream.call(this)
+  this.readable = true
+  this.writable = true
+
+  if (typeof options === 'string') {
+    options = {uri:options}
+  }
+
+  var reserved = Object.keys(Request.prototype)
+  for (var i in options) {
+    if (reserved.indexOf(i) === -1) {
+      this[i] = options[i]
+    } else {
+      if (typeof options[i] === 'function') {
+        delete options[i]
+      }
+    }
+  }
+
+  if (options.method) {
+    this.explicitMethod = true
+  }
+
+  this.init(options)
+}
+util.inherits(Request, stream.Stream)
+Request.prototype.init = function (options) {
+  // init() contains all the code to setup the request object.
+  // the actual outgoing request is not started until start() is called
+  // this function is called from both the constructor and on redirect.
+  var self = this
+  if (!options) options = {}
+
+  if (!self.method) self.method = options.method || 'GET'
+  self.localAddress = options.localAddress
+
+  debug(options)
+  if (!self.pool && self.pool !== false) self.pool = globalPool
+  self.dests = self.dests || []
+  self.__isRequestRequest = true
+
+  // Protect against double callback
+  if (!self._callback && self.callback) {
+    self._callback = self.callback
+    self.callback = function () {
+      if (self._callbackCalled) return // Print a warning maybe?
+      self._callbackCalled = true
+      self._callback.apply(self, arguments)
+    }
+    self.on('error', self.callback.bind())
+    self.on('complete', self.callback.bind(self, null))
+  }
+
+  if (self.url && !self.uri) {
+    // People use this property instead all the time so why not just support it.
+    self.uri = self.url
+    delete self.url
+  }
+
+  if (!self.uri) {
+    // this will throw if unhandled but is handleable when in a redirect
+    return self.emit('error', new Error("options.uri is a required argument"))
+  } else {
+    if (typeof self.uri == "string") self.uri = url.parse(self.uri)
+  }
+
+  if (self.strictSSL === false) {
+    self.rejectUnauthorized = false
+  }
+
+  if (self.proxy) {
+    if (typeof self.proxy == 'string') self.proxy = url.parse(self.proxy)
+
+    // do the HTTP CONNECT dance using koichik/node-tunnel
+    if (http.globalAgent && self.uri.protocol === "https:") {
+      var tunnelFn = self.proxy.protocol === "http:"
+                   ? tunnel.httpsOverHttp : tunnel.httpsOverHttps
+
+      var tunnelOptions = { proxy: { host: self.proxy.hostname
+                                   , port: +self.proxy.port
+                                   , proxyAuth: self.proxy.auth
+                                   , headers: { Host: self.uri.hostname + ':' +
+                                        (self.uri.port || self.uri.protocol === 'https:' ? 443 : 80) }}
+                          , rejectUnauthorized: self.rejectUnauthorized
+                          , ca: this.ca }
+
+      self.agent = tunnelFn(tunnelOptions)
+      self.tunnel = true
+    }
+  }
+
+  if (!self.uri.host || !self.uri.pathname) {
+    // Invalid URI: it may generate lot of bad errors, like "TypeError: Cannot call method 'indexOf' of undefined" in CookieJar
+    // Detect and reject it as soon as possible
+    var faultyUri = url.format(self.uri)
+    var message = 'Invalid URI "' + faultyUri + '"'
+    if (Object.keys(options).length === 0) {
+      // No option ? This can be the sign of a redirect
+      // As this is a case where the user cannot do anything (he didn't call request directly with this URL)
+      // he should be warned that it can be caused by a redirection (can save some hair)
+      message += '. This can be caused by a crappy redirection.'
+    }
+    self.emit('error', new Error(message))
+    return // This error was fatal
+  }
+
+  self._redirectsFollowed = self._redirectsFollowed || 0
+  self.maxRedirects = (self.maxRedirects !== undefined) ? self.maxRedirects : 10
+  self.followRedirect = (self.followRedirect !== undefined) ? self.followRedirect : true
+  self.followAllRedirects = (self.followAllRedirects !== undefined) ? self.followAllRedirects : false
+  if (self.followRedirect || self.followAllRedirects)
+    self.redirects = self.redirects || []
+
+  self.headers = self.headers ? copy(self.headers) : {}
+
+  self.setHost = false
+  if (!(self.headers.host || self.headers.Host)) {
+    self.headers.host = self.uri.hostname
+    if (self.uri.port) {
+      if ( !(self.uri.port === 80 && self.uri.protocol === 'http:') &&
+           !(self.uri.port === 443 && self.uri.protocol === 'https:') )
+      self.headers.host += (':'+self.uri.port)
+    }
+    self.setHost = true
+  }
+
+  self.jar(self._jar || options.jar)
+
+  if (!self.uri.pathname) {self.uri.pathname = '/'}
+  if (!self.uri.port) {
+    if (self.uri.protocol == 'http:') {self.uri.port = 80}
+    else if (self.uri.protocol == 'https:') {self.uri.port = 443}
+  }
+
+  if (self.proxy && !self.tunnel) {
+    self.port = self.proxy.port
+    self.host = self.proxy.hostname
+  } else {
+    self.port = self.uri.port
+    self.host = self.uri.hostname
+  }
+
+  self.clientErrorHandler = function (error) {
+    if (self._aborted) return
+
+    if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET'
+        && self.agent.addRequestNoreuse) {
+      self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
+      self.start()
+      self.req.end()
+      return
+    }
+    if (self.timeout && self.timeoutTimer) {
+      clearTimeout(self.timeoutTimer)
+      self.timeoutTimer = null
+    }
+    self.emit('error', error)
+  }
+
+  self._parserErrorHandler = function (error) {
+    if (this.res) {
+      if (this.res.request) {
+        this.res.request.emit('error', error)
+      } else {
+        this.res.emit('error', error)
+      }
+    } else {
+      this._httpMessage.emit('error', error)
+    }
+  }
+
+  if (options.form) {
+    self.form(options.form)
+  }
+
+  if (options.qs) self.qs(options.qs)
+
+  if (self.uri.path) {
+    self.path = self.uri.path
+  } else {
+    self.path = self.uri.pathname + (self.uri.search || "")
+  }
+
+  if (self.path.length === 0) self.path = '/'
+
+
+  // Auth must happen last in case signing is dependent on other headers
+  if (options.oauth) {
+    self.oauth(options.oauth)
+  }
+
+  if (options.aws) {
+    self.aws(options.aws)
+  }
+
+  if (options.hawk) {
+    self.hawk(options.hawk)
+  }
+
+  if (options.httpSignature) {
+    self.httpSignature(options.httpSignature)
+  }
+
+  if (options.auth) {
+    self.auth(
+      (options.auth.user==="") ? options.auth.user : (options.auth.user || options.auth.username ),
+      options.auth.pass || options.auth.password,
+      options.auth.sendImmediately)
+  }
+
+  if (self.uri.auth && !self.headers.authorization) {
+    var authPieces = self.uri.auth.split(':').map(function(item){ return querystring.unescape(item) })
+    self.auth(authPieces[0], authPieces.slice(1).join(':'), true)
+  }
+  if (self.proxy && self.proxy.auth && !self.headers['proxy-authorization'] && !self.tunnel) {
+    self.headers['proxy-authorization'] = "Basic " + toBase64(self.proxy.auth.split(':').map(function(item){ return querystring.unescape(item)}).join(':'))
+  }
+
+
+  if (self.proxy && !self.tunnel) self.path = (self.uri.protocol + '//' + self.uri.host + self.path)
+
+  if (options.json) {
+    self.json(options.json)
+  } else if (options.multipart) {
+    self.boundary = uuid()
+    self.multipart(options.multipart)
+  }
+
+  if (self.body) {
+    var length = 0
+    if (!Buffer.isBuffer(self.body)) {
+      if (Array.isArray(self.body)) {
+        for (var i = 0; i < self.body.length; i++) {
+          length += self.body[i].length
+        }
+      } else {
+        self.body = new Buffer(self.body)
+        length = self.body.length
+      }
+    } else {
+      length = self.body.length
+    }
+    if (length) {
+      if(!self.headers['content-length'] && !self.headers['Content-Length'])
+      self.headers['content-length'] = length
+    } else {
+      throw new Error('Argument error, options.body.')
+    }
+  }
+
+  var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
+    , defaultModules = {'http:':http, 'https:':https}
+    , httpModules = self.httpModules || {}
+    ;
+  self.httpModule = httpModules[protocol] || defaultModules[protocol]
+
+  if (!self.httpModule) return this.emit('error', new Error("Invalid protocol"))
+
+  if (options.ca) self.ca = options.ca
+
+  if (!self.agent) {
+    if (options.agentOptions) self.agentOptions = options.agentOptions
+
+    if (options.agentClass) {
+      self.agentClass = options.agentClass
+    } else if (options.forever) {
+      self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
+    } else {
+      self.agentClass = self.httpModule.Agent
+    }
+  }
+
+  if (self.pool === false) {
+    self.agent = false
+  } else {
+    self.agent = self.agent || self.getAgent()
+    if (self.maxSockets) {
+      // Don't use our pooling if node has the refactored client
+      self.agent.maxSockets = self.maxSockets
+    }
+    if (self.pool.maxSockets) {
+      // Don't use our pooling if node has the refactored client
+      self.agent.maxSockets = self.pool.maxSockets
+    }
+  }
+
+  self.on('pipe', function (src) {
+    if (self.ntick && self._started) throw new Error("You cannot pipe to this stream after the outbound request has started.")
+    self.src = src
+    if (isReadStream(src)) {
+      if (!self.headers['content-type'] && !self.headers['Content-Type'])
+        self.headers['content-type'] = mime.lookup(src.path)
+    } else {
+      if (src.headers) {
+        for (var i in src.headers) {
+          if (!self.headers[i]) {
+            self.headers[i] = src.headers[i]
+          }
+        }
+      }
+      if (self._json && !self.headers['content-type'] && !self.headers['Content-Type'])
+        self.headers['content-type'] = 'application/json'
+      if (src.method && !self.explicitMethod) {
+        self.method = src.method
+      }
+    }
+
+    // self.on('pipe', function () {
+    //   console.error("You have already piped to this stream. Pipeing twice is likely to break the request.")
+    // })
+  })
+
+  process.nextTick(function () {
+    if (self._aborted) return
+
+    if (self._form) {
+      self.setHeaders(self._form.getHeaders())
+      self._form.pipe(self)
+    }
+    if (self.body) {
+      if (Array.isArray(self.body)) {
+        self.body.forEach(function (part) {
+          self.write(part)
+        })
+      } else {
+        self.write(self.body)
+      }
+      self.end()
+    } else if (self.requestBodyStream) {
+      console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe.")
+      self.requestBodyStream.pipe(self)
+    } else if (!self.src) {
+      if (self.method !== 'GET' && typeof self.method !== 'undefined') {
+        self.headers['content-length'] = 0
+      }
+      self.end()
+    }
+    self.ntick = true
+  })
+}
+
+// Must call this when following a redirect from https to http or vice versa
+// Attempts to keep everything as identical as possible, but update the
+// httpModule, Tunneling agent, and/or Forever Agent in use.
+Request.prototype._updateProtocol = function () {
+  var self = this
+  var protocol = self.uri.protocol
+
+  if (protocol === 'https:') {
+    // previously was doing http, now doing https
+    // if it's https, then we might need to tunnel now.
+    if (self.proxy) {
+      self.tunnel = true
+      var tunnelFn = self.proxy.protocol === 'http:'
+                   ? tunnel.httpsOverHttp : tunnel.httpsOverHttps
+      var tunnelOptions = { proxy: { host: self.proxy.hostname
+                                   , port: +self.proxy.port
+                                   , proxyAuth: self.proxy.auth }
+                          , rejectUnauthorized: self.rejectUnauthorized
+                          , ca: self.ca }
+      self.agent = tunnelFn(tunnelOptions)
+      return
+    }
+
+    self.httpModule = https
+    switch (self.agentClass) {
+      case ForeverAgent:
+        self.agentClass = ForeverAgent.SSL
+        break
+      case http.Agent:
+        self.agentClass = https.Agent
+        break
+      default:
+        // nothing we can do.  Just hope for the best.
+        return
+    }
+
+    // if there's an agent, we need to get a new one.
+    if (self.agent) self.agent = self.getAgent()
+
+  } else {
+    // previously was doing https, now doing http
+    // stop any tunneling.
+    if (self.tunnel) self.tunnel = false
+    self.httpModule = http
+    switch (self.agentClass) {
+      case ForeverAgent.SSL:
+        self.agentClass = ForeverAgent
+        break
+      case https.Agent:
+        self.agentClass = http.Agent
+        break
+      default:
+        // nothing we can do.  just hope for the best
+        return
+    }
+
+    // if there's an agent, then get a new one.
+    if (self.agent) {
+      self.agent = null
+      self.agent = self.getAgent()
+    }
+  }
+}
+
+Request.prototype.getAgent = function () {
+  var Agent = this.agentClass
+  var options = {}
+  if (this.agentOptions) {
+    for (var i in this.agentOptions) {
+      options[i] = this.agentOptions[i]
+    }
+  }
+  if (this.ca) options.ca = this.ca
+  if (typeof this.rejectUnauthorized !== 'undefined') options.rejectUnauthorized = this.rejectUnauthorized
+
+  if (this.cert && this.key) {
+    options.key = this.key
+    options.cert = this.cert
+  }
+
+  var poolKey = ''
+
+  // different types of agents are in different pools
+  if (Agent !== this.httpModule.Agent) {
+    poolKey += Agent.name
+  }
+
+  if (!this.httpModule.globalAgent) {
+    // node 0.4.x
+    options.host = this.host
+    options.port = this.port
+    if (poolKey) poolKey += ':'
+    poolKey += this.host + ':' + this.port
+  }
+
+  // ca option is only relevant if proxy or destination are https
+  var proxy = this.proxy
+  if (typeof proxy === 'string') proxy = url.parse(proxy)
+  var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'
+  if (isHttps) {
+    if (options.ca) {
+      if (poolKey) poolKey += ':'
+      poolKey += options.ca
+    }
+
+    if (typeof options.rejectUnauthorized !== 'undefined') {
+      if (poolKey) poolKey += ':'
+      poolKey += options.rejectUnauthorized
+    }
+
+    if (options.cert)
+      poolKey += options.cert.toString('ascii') + options.key.toString('ascii')
+
+    if (options.ciphers) {
+      if (poolKey) poolKey += ':'
+      poolKey += options.ciphers
+    }
+
+    if (options.secureOptions) {
+      if (poolKey) poolKey += ':'
+      poolKey += options.secureOptions
+    }
+  }
+
+  if (this.pool === globalPool && !poolKey && Object.keys(options).length === 0 && this.httpModule.globalAgent) {
+    // not doing anything special.  Use the globalAgent
+    return this.httpModule.globalAgent
+  }
+
+  // we're using a stored agent.  Make sure it's protocol-specific
+  poolKey = this.uri.protocol + poolKey
+
+  // already generated an agent for this setting
+  if (this.pool[poolKey]) return this.pool[poolKey]
+
+  return this.pool[poolKey] = new Agent(options)
+}
+
+Request.prototype.start = function () {
+  // start() is called once we are ready to send the outgoing HTTP request.
+  // this is usually called on the first write(), end() or on nextTick()
+  var self = this
+
+  if (self._aborted) return
+
+  self._started = true
+  self.method = self.method || 'GET'
+  self.href = self.uri.href
+
+  if (self.src && self.src.stat && self.src.stat.size && !self.headers['content-length'] && !self.headers['Content-Length']) {
+    self.headers['content-length'] = self.src.stat.size
+  }
+  if (self._aws) {
+    self.aws(self._aws, true)
+  }
+
+  // We have a method named auth, which is completely different from the http.request
+  // auth option.  If we don't remove it, we're gonna have a bad time.
+  var reqOptions = copy(self)
+  delete reqOptions.auth
+
+  debug('make request', self.uri.href)
+  self.req = self.httpModule.request(reqOptions, self.onResponse.bind(self))
+
+  if (self.timeout && !self.timeoutTimer) {
+    self.timeoutTimer = setTimeout(function () {
+      self.req.abort()
+      var e = new Error("ETIMEDOUT")
+      e.code = "ETIMEDOUT"
+      self.emit("error", e)
+    }, self.timeout)
+
+    // Set additional timeout on socket - in case if remote
+    // server freeze after sending headers
+    if (self.req.setTimeout) { // only works on node 0.6+
+      self.req.setTimeout(self.timeout, function () {
+        if (self.req) {
+          self.req.abort()
+          var e = new Error("ESOCKETTIMEDOUT")
+          e.code = "ESOCKETTIMEDOUT"
+          self.emit("error", e)
+        }
+      })
+    }
+  }
+
+  self.req.on('error', self.clientErrorHandler)
+  self.req.on('drain', function() {
+    self.emit('drain')
+  })
+  self.on('end', function() {
+    if ( self.req.connection ) self.req.connection.removeListener('error', self._parserErrorHandler)
+  })
+  self.emit('request', self.req)
+}
+Request.prototype.onResponse = function (response) {
+  var self = this
+  debug('onResponse', self.uri.href, response.statusCode, response.headers)
+  response.on('end', function() {
+    debug('response end', self.uri.href, response.statusCode, response.headers)
+  });
+
+  if (response.connection.listeners('error').indexOf(self._parserErrorHandler) === -1) {
+    response.connection.once('error', self._parserErrorHandler)
+  }
+  if (self._aborted) {
+    debug('aborted', self.uri.href)
+    response.resume()
+    return
+  }
+  if (self._paused) response.pause()
+  else response.resume()
+
+  self.response = response
+  response.request = self
+  response.toJSON = toJSON
+
+  // XXX This is different on 0.10, because SSL is strict by default
+  if (self.httpModule === https &&
+      self.strictSSL &&
+      !response.client.authorized) {
+    debug('strict ssl error', self.uri.href)
+    var sslErr = response.client.authorizationError
+    self.emit('error', new Error('SSL Error: '+ sslErr))
+    return
+  }
+
+  if (self.setHost) delete self.headers.host
+  if (self.timeout && self.timeoutTimer) {
+    clearTimeout(self.timeoutTimer)
+    self.timeoutTimer = null
+  }
+
+  var addCookie = function (cookie) {
+    if (self._jar){
+      if(self._jar.add){
+        self._jar.add(new Cookie(cookie))
+      }
+      else cookieJar.add(new Cookie(cookie))
+    }
+
+  }
+
+  if (response.headers['set-cookie'] && (!self._disableCookies)) {
+    if (Array.isArray(response.headers['set-cookie'])) response.headers['set-cookie'].forEach(addCookie)
+    else addCookie(response.headers['set-cookie'])
+  }
+
+  var redirectTo = null
+  if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
+    debug('redirect', response.headers.location)
+
+    if (self.followAllRedirects) {
+      redirectTo = response.headers.location
+    } else if (self.followRedirect) {
+      switch (self.method) {
+        case 'PATCH':
+        case 'PUT':
+        case 'POST':
+        case 'DELETE':
+          // Do not follow redirects
+          break
+        default:
+          redirectTo = response.headers.location
+          break
+      }
+    }
+  } else if (response.statusCode == 401 && self._hasAuth && !self._sentAuth) {
+    var authHeader = response.headers['www-authenticate']
+    var authVerb = authHeader && authHeader.split(' ')[0]
+    debug('reauth', authVerb)
+
+    switch (authVerb) {
+      case 'Basic':
+        self.auth(self._user, self._pass, true)
+        redirectTo = self.uri
+        break
+
+      case 'Digest':
+        // TODO: More complete implementation of RFC 2617.  For reference:
+        // http://tools.ietf.org/html/rfc2617#section-3
+        // https://github.com/bagder/curl/blob/master/lib/http_digest.c
+
+        var matches = authHeader.match(/([a-z0-9_-]+)="([^"]+)"/gi)
+        var challenge = {}
+
+        for (var i = 0; i < matches.length; i++) {
+          var eqPos = matches[i].indexOf('=')
+          var key = matches[i].substring(0, eqPos)
+          var quotedValue = matches[i].substring(eqPos + 1)
+          challenge[key] = quotedValue.substring(1, quotedValue.length - 1)
+        }
+
+        var ha1 = md5(self._user + ':' + challenge.realm + ':' + self._pass)
+        var ha2 = md5(self.method + ':' + self.uri.path)
+        var digestResponse = md5(ha1 + ':' + challenge.nonce + ':1::auth:' + ha2)
+        var authValues = {
+          username: self._user,
+          realm: challenge.realm,
+          nonce: challenge.nonce,
+          uri: self.uri.path,
+          qop: challenge.qop,
+          response: digestResponse,
+          nc: 1,
+          cnonce: ''
+        }
+
+        authHeader = []
+        for (var k in authValues) {
+          authHeader.push(k + '="' + authValues[k] + '"')
+        }
+        authHeader = 'Digest ' + authHeader.join(', ')
+        self.setHeader('authorization', authHeader)
+        self._sentAuth = true
+
+        redirectTo = self.uri
+        break
+    }
+  }
+
+  if (redirectTo) {
+    debug('redirect to', redirectTo)
+
+    // ignore any potential response body.  it cannot possibly be useful
+    // to us at this point.
+    if (self._paused) response.resume()
+
+    if (self._redirectsFollowed >= self.maxRedirects) {
+      self.emit('error', new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+self.uri.href))
+      return
+    }
+    self._redirectsFollowed += 1
+
+    if (!isUrl.test(redirectTo)) {
+      redirectTo = url.resolve(self.uri.href, redirectTo)
+    }
+
+    var uriPrev = self.uri
+    self.uri = url.parse(redirectTo)
+
+    // handle the case where we change protocol from https to http or vice versa
+    if (self.uri.protocol !== uriPrev.protocol) {
+      self._updateProtocol()
+    }
+
+    self.redirects.push(
+      { statusCode : response.statusCode
+      , redirectUri: redirectTo
+      }
+    )
+    if (self.followAllRedirects && response.statusCode != 401) self.method = 'GET'
+    // self.method = 'GET' // Force all redirects to use GET || commented out fixes #215
+    delete self.src
+    delete self.req
+    delete self.agent
+    delete self._started
+    if (response.statusCode != 401) {
+      // Remove parameters from the previous response, unless this is the second request
+      // for a server that requires digest authentication.
+      delete self.body
+      delete self._form
+      if (self.headers) {
+        delete self.headers.host
+        delete self.headers['content-type']
+        delete self.headers['content-length']
+      }
+    }
+
+    self.emit('redirect');
+
+    self.init()
+    return // Ignore the rest of the response
+  } else {
+    self._redirectsFollowed = self._redirectsFollowed || 0
+    // Be a good stream and emit end when the response is finished.
+    // Hack to emit end on close because of a core bug that never fires end
+    response.on('close', function () {
+      if (!self._ended) self.response.emit('end')
+    })
+
+    if (self.encoding) {
+      if (self.dests.length !== 0) {
+        console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.")
+      } else {
+        response.setEncoding(self.encoding)
+      }
+    }
+
+    self.emit('response', response)
+
+    self.dests.forEach(function (dest) {
+      self.pipeDest(dest)
+    })
+
+    response.on("data", function (chunk) {
+      self._destdata = true
+      self.emit("data", chunk)
+    })
+    response.on("end", function (chunk) {
+      self._ended = true
+      self.emit("end", chunk)
+    })
+    response.on("close", function () {self.emit("close")})
+
+    if (self.callback) {
+      var buffer = []
+      var bodyLen = 0
+      self.on("data", function (chunk) {
+        buffer.push(chunk)
+        bodyLen += chunk.length
+      })
+      self.on("end", function () {
+        debug('end event', self.uri.href)
+        if (self._aborted) {
+          debug('aborted', self.uri.href)
+          return
+        }
+
+        if (buffer.length && Buffer.isBuffer(buffer[0])) {
+          debug('has body', self.uri.href, bodyLen)
+          var body = new Buffer(bodyLen)
+          var i = 0
+          buffer.forEach(function (chunk) {
+            chunk.copy(body, i, 0, chunk.length)
+            i += chunk.length
+          })
+          if (self.encoding === null) {
+            response.body = body
+          } else {
+            response.body = body.toString(self.encoding)
+          }
+        } else if (buffer.length) {
+          // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
+          // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
+          if (self.encoding === 'utf8' && buffer[0].length > 0 && buffer[0][0] === "\uFEFF") {
+            buffer[0] = buffer[0].substring(1)
+          }
+          response.body = buffer.join('')
+        }
+
+        if (self._json) {
+          try {
+            response.body = JSON.parse(response.body)
+          } catch (e) {}
+        }
+        debug('emitting complete', self.uri.href)
+        if(response.body == undefined && !self._json) {
+          response.body = "";
+        }
+        self.emit('complete', response, response.body)
+      })
+    }
+    //if no callback
+    else{
+      self.on("end", function () {
+        if (self._aborted) {
+          debug('aborted', self.uri.href)
+          return
+        }
+        self.emit('complete', response);
+      });
+    }
+  }
+  debug('finish init function', self.uri.href)
+}
+
+Request.prototype.abort = function () {
+  this._aborted = true
+
+  if (this.req) {
+    this.req.abort()
+  }
+  else if (this.response) {
+    this.response.abort()
+  }
+
+  this.emit("abort")
+}
+
+Request.prototype.pipeDest = function (dest) {
+  var response = this.response
+  // Called after the response is received
+  if (dest.headers) {
+    dest.headers['content-type'] = response.headers['content-type']
+    if (response.headers['content-length']) {
+      dest.headers['content-length'] = response.headers['content-length']
+    }
+  }
+  if (dest.setHeader && !dest.headersSent) {
+    for (var i in response.headers) {
+      dest.setHeader(i, response.headers[i])
+    }
+    dest.statusCode = response.statusCode
+  }
+  if (this.pipefilter) this.pipefilter(response, dest)
+}
+
+// Composable API
+Request.prototype.setHeader = function (name, value, clobber) {
+  if (clobber === undefined) clobber = true
+  if (clobber || !this.headers.hasOwnProperty(name)) this.headers[name] = value
+  else this.headers[name] += ',' + value
+  return this
+}
+Request.prototype.setHeaders = function (headers) {
+  for (var i in headers) {this.setHeader(i, headers[i])}
+  return this
+}
+Request.prototype.qs = function (q, clobber) {
+  var base
+  if (!clobber && this.uri.query) base = qs.parse(this.uri.query)
+  else base = {}
+
+  for (var i in q) {
+    base[i] = q[i]
+  }
+
+  if (qs.stringify(base) === ''){
+    return this
+  }
+
+  this.uri = url.parse(this.uri.href.split('?')[0] + '?' + qs.stringify(base))
+  this.url = this.uri
+  this.path = this.uri.path
+
+  return this
+}
+Request.prototype.form = function (form) {
+  if (form) {
+    this.headers['content-type'] = 'application/x-www-form-urlencoded; charset=utf-8'
+    this.body = qs.stringify(form).toString('utf8')
+    return this
+  }
+  // create form-data object
+  this._form = new FormData()
+  return this._form
+}
+Request.prototype.multipart = function (multipart) {
+  var self = this
+  self.body = []
+
+  if (!self.headers['content-type']) {
+    self.headers['content-type'] = 'multipart/related; boundary=' + self.boundary
+  } else {
+    self.headers['content-type'] = self.headers['content-type'].split(';')[0] + '; boundary=' + self.boundary
+  }
+
+  if (!multipart.forEach) throw new Error('Argument error, options.multipart.')
+
+  if (self.preambleCRLF) {
+    self.body.push(new Buffer('\r\n'))
+  }
+
+  multipart.forEach(function (part) {
+    var body = part.body
+    if(body == null) throw Error('Body attribute missing in multipart.')
+    delete part.body
+    var preamble = '--' + self.boundary + '\r\n'
+    Object.keys(part).forEach(function (key) {
+      preamble += key + ': ' + part[key] + '\r\n'
+    })
+    preamble += '\r\n'
+    self.body.push(new Buffer(preamble))
+    self.body.push(new Buffer(body))
+    self.body.push(new Buffer('\r\n'))
+  })
+  self.body.push(new Buffer('--' + self.boundary + '--'))
+  return self
+}
+Request.prototype.json = function (val) {
+  var self = this;
+  var setAcceptHeader = function() {
+  	if (!self.headers['accept'] && !self.headers['Accept']) {
+			  self.setHeader('accept', 'application/json')
+		}
+	}
+  setAcceptHeader();
+  this._json = true
+  if (typeof val === 'boolean') {
+    if (typeof this.body === 'object') {
+      setAcceptHeader();
+      this.body = safeStringify(this.body)
+      self.setHeader('content-type', 'application/json')
+    }
+  } else {
+    setAcceptHeader();
+    this.body = safeStringify(val)
+    self.setHeader('content-type', 'application/json')
+  }
+  return this
+}
+function getHeader(name, headers) {
+    var result, re, match
+    Object.keys(headers).forEach(function (key) {
+        re = new RegExp(name, 'i')
+        match = key.match(re)
+        if (match) result = headers[key]
+    })
+    return result
+}
+Request.prototype.auth = function (user, pass, sendImmediately) {
+  if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
+    throw new Error('auth() received invalid user or password')
+  }
+  this._user = user
+  this._pass = pass
+  this._hasAuth = true
+  if (sendImmediately || typeof sendImmediately == 'undefined') {
+    this.setHeader('authorization', 'Basic ' + toBase64(user + ':' + pass))
+    this._sentAuth = true
+  }
+  return this
+}
+Request.prototype.aws = function (opts, now) {
+  if (!now) {
+    this._aws = opts
+    return this
+  }
+  var date = new Date()
+  this.setHeader('date', date.toUTCString())
+  var auth =
+    { key: opts.key
+    , secret: opts.secret
+    , verb: this.method.toUpperCase()
+    , date: date
+    , contentType: getHeader('content-type', this.headers) || ''
+    , md5: getHeader('content-md5', this.headers) || ''
+    , amazonHeaders: aws.canonicalizeHeaders(this.headers)
+    }
+  if (opts.bucket && this.path) {
+    auth.resource = '/' + opts.bucket + this.path
+  } else if (opts.bucket && !this.path) {
+    auth.resource = '/' + opts.bucket
+  } else if (!opts.bucket && this.path) {
+    auth.resource = this.path
+  } else if (!opts.bucket && !this.path) {
+    auth.resource = '/'
+  }
+  auth.resource = aws.canonicalizeResource(auth.resource)
+  this.setHeader('authorization', aws.authorization(auth))
+
+  return this
+}
+Request.prototype.httpSignature = function (opts) {
+  var req = this
+  httpSignature.signRequest({
+    getHeader: function(header) {
+      return getHeader(header, req.headers)
+    },
+    setHeader: function(header, value) {
+      req.setHeader(header, value)
+    },
+    method: this.method,
+    path: this.path
+  }, opts)
+  debug('httpSignature authorization', getHeader('authorization', this.headers))
+
+  return this
+}
+
+Request.prototype.hawk = function (opts) {
+  this.headers.Authorization = hawk.client.header(this.uri, this.method, opts).field
+}
+
+Request.prototype.oauth = function (_oauth) {
+  var form
+  if (this.headers['content-type'] &&
+      this.headers['content-type'].slice(0, 'application/x-www-form-urlencoded'.length) ===
+        'application/x-www-form-urlencoded'
+     ) {
+    form = qs.parse(this.body)
+  }
+  if (this.uri.query) {
+    form = qs.parse(this.uri.query)
+  }
+  if (!form) form = {}
+  var oa = {}
+  for (var i in form) oa[i] = form[i]
+  for (var i in _oauth) oa['oauth_'+i] = _oauth[i]
+  if (!oa.oauth_version) oa.oauth_version = '1.0'
+  if (!oa.oauth_timestamp) oa.oauth_timestamp = Math.floor( Date.now() / 1000 ).toString()
+  if (!oa.oauth_nonce) oa.oauth_nonce = uuid().replace(/-/g, '')
+
+  oa.oauth_signature_method = 'HMAC-SHA1'
+
+  var consumer_secret = oa.oauth_consumer_secret
+  delete oa.oauth_consumer_secret
+  var token_secret = oa.oauth_token_secret
+  delete oa.oauth_token_secret
+  var timestamp = oa.oauth_timestamp
+
+  var baseurl = this.uri.protocol + '//' + this.uri.host + this.uri.pathname
+  var signature = oauth.hmacsign(this.method, baseurl, oa, consumer_secret, token_secret)
+
+  // oa.oauth_signature = signature
+  for (var i in form) {
+    if ( i.slice(0, 'oauth_') in _oauth) {
+      // skip
+    } else {
+      delete oa['oauth_'+i]
+      if (i !== 'x_auth_mode') delete oa[i]
+    }
+  }
+  oa.oauth_timestamp = timestamp
+  this.headers.Authorization =
+    'OAuth '+Object.keys(oa).sort().map(function (i) {return i+'="'+oauth.rfc3986(oa[i])+'"'}).join(',')
+  this.headers.Authorization += ',oauth_signature="' + oauth.rfc3986(signature) + '"'
+  return this
+}
+Request.prototype.jar = function (jar) {
+  var cookies
+
+  if (this._redirectsFollowed === 0) {
+    this.originalCookieHeader = this.headers.cookie
+  }
+
+  if (!jar) {
+    // disable cookies
+    cookies = false
+    this._disableCookies = true
+  } else if (jar && jar.get) {
+    // fetch cookie from the user defined cookie jar
+    cookies = jar.get({ url: this.uri.href })
+  } else {
+    // fetch cookie from the global cookie jar
+    cookies = cookieJar.get({ url: this.uri.href })
+  }
+
+  if (cookies && cookies.length) {
+    var cookieString = cookies.map(function (c) {
+      return c.name + "=" + c.value
+    }).join("; ")
+
+    if (this.originalCookieHeader) {
+      // Don't overwrite existing Cookie header
+      this.headers.cookie = this.originalCookieHeader + '; ' + cookieString
+    } else {
+      this.headers.cookie = cookieString
+    }
+  }
+  this._jar = jar
+  return this
+}
+
+
+// Stream API
+Request.prototype.pipe = function (dest, opts) {
+  if (this.response) {
+    if (this._destdata) {
+      throw new Error("You cannot pipe after data has been emitted from the response.")
+    } else if (this._ended) {
+      throw new Error("You cannot pipe after the response has been ended.")
+    } else {
+      stream.Stream.prototype.pipe.call(this, dest, opts)
+      this.pipeDest(dest)
+      return dest
+    }
+  } else {
+    this.dests.push(dest)
+    stream.Stream.prototype.pipe.call(this, dest, opts)
+    return dest
+  }
+}
+Request.prototype.write = function () {
+  if (!this._started) this.start()
+  return this.req.write.apply(this.req, arguments)
+}
+Request.prototype.end = function (chunk) {
+  if (chunk) this.write(chunk)
+  if (!this._started) this.start()
+  this.req.end()
+}
+Request.prototype.pause = function () {
+  if (!this.response) this._paused = true
+  else this.response.pause.apply(this.response, arguments)
+}
+Request.prototype.resume = function () {
+  if (!this.response) this._paused = false
+  else this.response.resume.apply(this.response, arguments)
+}
+Request.prototype.destroy = function () {
+  if (!this._ended) this.end()
+  else if (this.response) this.response.destroy()
+}
+
+// organize params for patch, post, put, head, del
+function initParams(uri, options, callback) {
+  if ((typeof options === 'function') && !callback) callback = options
+  if (options && typeof options === 'object') {
+    options.uri = uri
+  } else if (typeof uri === 'string') {
+    options = {uri:uri}
+  } else {
+    options = uri
+    uri = options.uri
+  }
+  return { uri: uri, options: options, callback: callback }
+}
+
+function request (uri, options, callback) {
+  if (typeof uri === 'undefined') throw new Error('undefined is not a valid uri or options object.')
+  if ((typeof options === 'function') && !callback) callback = options
+  if (options && typeof options === 'object') {
+    options.uri = uri
+  } else if (typeof uri === 'string') {
+    options = {uri:uri}
+  } else {
+    options = uri
+  }
+
+  options = copy(options)
+
+  if (callback) options.callback = callback
+  var r = new Request(options)
+  return r
+}
+
+module.exports = request
+
+request.Request = Request;
+
+request.debug = process.env.NODE_DEBUG && /request/.test(process.env.NODE_DEBUG)
+
+request.initParams = initParams
+
+request.defaults = function (options, requester) {
+  var def = function (method) {
+    var d = function (uri, opts, callback) {
+      var params = initParams(uri, opts, callback)
+      for (var i in options) {
+        if (params.options[i] === undefined) params.options[i] = options[i]
+      }
+      if(typeof requester === 'function') {
+        if(method === request) {
+          method = requester
+        } else {
+          params.options._requester = requester
+        }
+      }
+      return method(params.options, params.callback)
+    }
+    return d
+  }
+  var de = def(request)
+  de.get = def(request.get)
+  de.patch = def(request.patch)
+  de.post = def(request.post)
+  de.put = def(request.put)
+  de.head = def(request.head)
+  de.del = def(request.del)
+  de.cookie = def(request.cookie)
+  de.jar = request.jar
+  return de
+}
+
+request.forever = function (agentOptions, optionsArg) {
+  var options = {}
+  if (optionsArg) {
+    for (option in optionsArg) {
+      options[option] = optionsArg[option]
+    }
+  }
+  if (agentOptions) options.agentOptions = agentOptions
+  options.forever = true
+  return request.defaults(options)
+}
+
+request.get = request
+request.post = function (uri, options, callback) {
+  var params = initParams(uri, options, callback)
+  params.options.method = 'POST'
+  return request(params.uri || null, params.options, params.callback)
+}
+request.put = function (uri, options, callback) {
+  var params = initParams(uri, options, callback)
+  params.options.method = 'PUT'
+  return request(params.uri || null, params.options, params.callback)
+}
+request.patch = function (uri, options, callback) {
+  var params = initParams(uri, options, callback)
+  params.options.method = 'PATCH'
+  return request(params.uri || null, params.options, params.callback)
+}
+request.head = function (uri, options, callback) {
+  var params = initParams(uri, options, callback)
+  params.options.method = 'HEAD'
+  if (params.options.body ||
+      params.options.requestBodyStream ||
+      (params.options.json && typeof params.options.json !== 'boolean') ||
+      params.options.multipart) {
+    throw new Error("HTTP HEAD requests MUST NOT include a request body.")
+  }
+  return request(params.uri || null, params.options, params.callback)
+}
+request.del = function (uri, options, callback) {
+  var params = initParams(uri, options, callback)
+  params.options.method = 'DELETE'
+  if(typeof params.options._requester === 'function') {
+    request = params.options._requester
+  }
+  return request(params.uri || null, params.options, params.callback)
+}
+request.jar = function () {
+  return new CookieJar
+}
+request.cookie = function (str) {
+  if (str && str.uri) str = str.uri
+  if (typeof str !== 'string') throw new Error("The cookie function only accepts STRING as param")
+  return new Cookie(str)
+}
+
+// Safe toJSON
+
+function getSafe (self, uuid) {
+  if (typeof self === 'object' || typeof self === 'function') var safe = {}
+  if (Array.isArray(self)) var safe = []
+
+  var recurse = []
+
+  Object.defineProperty(self, uuid, {})
+
+  var attrs = Object.keys(self).filter(function (i) {
+    if (i === uuid) return false
+    if ( (typeof self[i] !== 'object' && typeof self[i] !== 'function') || self[i] === null) return true
+    return !(Object.getOwnPropertyDescriptor(self[i], uuid))
+  })
+
+
+  for (var i=0;i<attrs.length;i++) {
+    if ( (typeof self[attrs[i]] !== 'object' && typeof self[attrs[i]] !== 'function') ||
+          self[attrs[i]] === null
+        ) {
+      safe[attrs[i]] = self[attrs[i]]
+    } else {
+      recurse.push(attrs[i])
+      Object.defineProperty(self[attrs[i]], uuid, {})
+    }
+  }
+
+  for (var i=0;i<recurse.length;i++) {
+    safe[recurse[i]] = getSafe(self[recurse[i]], uuid)
+  }
+
+  return safe
+}
+
+function toJSON () {
+  return getSafe(this, '__' + (((1+Math.random())*0x10000)|0).toString(16))
+}
+
+Request.prototype.toJSON = toJSON
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/LICENSE	(revision 487)
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/README.md	(revision 487)
@@ -0,0 +1,4 @@
+aws-sign
+========
+
+AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/index.js	(revision 487)
@@ -0,0 +1,202 @@
+
+/*!
+ * knox - auth
+ * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var crypto = require('crypto')
+  , parse = require('url').parse
+  ;
+
+/**
+ * Valid keys.
+ */
+
+var keys = 
+  [ 'acl'
+  , 'location'
+  , 'logging'
+  , 'notification'
+  , 'partNumber'
+  , 'policy'
+  , 'requestPayment'
+  , 'torrent'
+  , 'uploadId'
+  , 'uploads'
+  , 'versionId'
+  , 'versioning'
+  , 'versions'
+  , 'website'
+  ]
+
+/**
+ * Return an "Authorization" header value with the given `options`
+ * in the form of "AWS <key>:<signature>"
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function authorization (options) {
+  return 'AWS ' + options.key + ':' + sign(options)
+}
+
+module.exports = authorization
+module.exports.authorization = authorization
+
+/**
+ * Simple HMAC-SHA1 Wrapper
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */ 
+
+function hmacSha1 (options) {
+  return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')
+}
+
+module.exports.hmacSha1 = hmacSha1
+
+/**
+ * Create a base64 sha1 HMAC for `options`. 
+ * 
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function sign (options) {
+  options.message = stringToSign(options)
+  return hmacSha1(options)
+}
+module.exports.sign = sign
+
+/**
+ * Create a base64 sha1 HMAC for `options`. 
+ *
+ * Specifically to be used with S3 presigned URLs
+ * 
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function signQuery (options) {
+  options.message = queryStringToSign(options)
+  return hmacSha1(options)
+}
+module.exports.signQuery= signQuery
+
+/**
+ * Return a string for sign() with the given `options`.
+ *
+ * Spec:
+ * 
+ *    <verb>\n
+ *    <md5>\n
+ *    <content-type>\n
+ *    <date>\n
+ *    [headers\n]
+ *    <resource>
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function stringToSign (options) {
+  var headers = options.amazonHeaders || ''
+  if (headers) headers += '\n'
+  var r = 
+    [ options.verb
+    , options.md5
+    , options.contentType
+    , options.date.toUTCString()
+    , headers + options.resource
+    ]
+  return r.join('\n')
+}
+module.exports.queryStringToSign = stringToSign
+
+/**
+ * Return a string for sign() with the given `options`, but is meant exclusively
+ * for S3 presigned URLs
+ *
+ * Spec:
+ * 
+ *    <date>\n
+ *    <resource>
+ *
+ * @param {Object} options
+ * @return {String}
+ * @api private
+ */
+
+function queryStringToSign (options){
+  return 'GET\n\n\n' + options.date + '\n' + options.resource
+}
+module.exports.queryStringToSign = queryStringToSign
+
+/**
+ * Perform the following:
+ *
+ *  - ignore non-amazon headers
+ *  - lowercase fields
+ *  - sort lexicographically
+ *  - trim whitespace between ":"
+ *  - join with newline
+ *
+ * @param {Object} headers
+ * @return {String}
+ * @api private
+ */
+
+function canonicalizeHeaders (headers) {
+  var buf = []
+    , fields = Object.keys(headers)
+    ;
+  for (var i = 0, len = fields.length; i < len; ++i) {
+    var field = fields[i]
+      , val = headers[field]
+      , field = field.toLowerCase()
+      ;
+    if (0 !== field.indexOf('x-amz')) continue
+    buf.push(field + ':' + val)
+  }
+  return buf.sort().join('\n')
+}
+module.exports.canonicalizeHeaders = canonicalizeHeaders
+
+/**
+ * Perform the following:
+ *
+ *  - ignore non sub-resources
+ *  - sort lexicographically
+ *
+ * @param {String} resource
+ * @return {String}
+ * @api private
+ */
+
+function canonicalizeResource (resource) {
+  var url = parse(resource, true)
+    , path = url.pathname
+    , buf = []
+    ;
+
+  Object.keys(url.query).forEach(function(key){
+    if (!~keys.indexOf(key)) return
+    var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
+    buf.push(key + val)
+  })
+
+  return path + (buf.length ? '?' + buf.sort().join('&') : '')
+}
+module.exports.canonicalizeResource = canonicalizeResource
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/aws-sign/package.json	(revision 487)
@@ -0,0 +1,28 @@
+{
+  "author": {
+    "name": "Mikeal Rogers",
+    "email": "mikeal.rogers@gmail.com",
+    "url": "http://www.futurealoof.com"
+  },
+  "name": "aws-sign",
+  "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.",
+  "version": "0.3.0",
+  "repository": {
+    "url": "https://github.com/mikeal/aws-sign"
+  },
+  "main": "index.js",
+  "dependencies": {},
+  "devDependencies": {},
+  "optionalDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/mikeal/aws-sign/issues"
+  },
+  "homepage": "https://github.com/mikeal/aws-sign",
+  "_id": "aws-sign@0.3.0",
+  "_from": "aws-sign@~0.3.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/LICENSE	(revision 487)
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/README.md	(revision 487)
@@ -0,0 +1,4 @@
+cookie-jar
+==========
+
+Cookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/index.js	(revision 487)
@@ -0,0 +1,67 @@
+/*!
+ * Tobi - Cookie
+ * Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+ * MIT Licensed
+ */
+
+/**
+ * Module dependencies.
+ */
+
+var url = require('url');
+
+/**
+ * Initialize a new `Cookie` with the given cookie `str` and `req`.
+ *
+ * @param {String} str
+ * @param {IncomingRequest} req
+ * @api private
+ */
+
+var Cookie = exports = module.exports = function Cookie(str, req) {
+  this.str = str;
+
+  // Map the key/val pairs
+  str.split(/ *; */).reduce(function(obj, pair){
+   var p = pair.indexOf('=');
+   var key = p > 0 ? pair.substring(0, p).trim() : pair.trim();
+   var lowerCasedKey = key.toLowerCase();
+   var value = p > 0 ? pair.substring(p + 1).trim() : true;
+
+   if (!obj.name) {
+    // First key is the name
+    obj.name = key;
+    obj.value = value;
+   }
+   else if (lowerCasedKey === 'httponly') {
+    obj.httpOnly = value;
+   }
+   else {
+    obj[lowerCasedKey] = value;
+   }
+   return obj;
+  }, this);
+
+  // Expires
+  this.expires = this.expires
+    ? new Date(this.expires)
+    : Infinity;
+
+  // Default or trim path
+  this.path = this.path
+    ? this.path.trim(): req 
+    ? url.parse(req.url).pathname: '/';
+};
+
+/**
+ * Return the original cookie string.
+ *
+ * @return {String}
+ * @api public
+ */
+
+Cookie.prototype.toString = function(){
+  return this.str;
+};
+
+module.exports.Jar = require('./jar')
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/jar.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/jar.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/jar.js	(revision 487)
@@ -0,0 +1,72 @@
+/*!
+* Tobi - CookieJar
+* Copyright(c) 2010 LearnBoost <dev@learnboost.com>
+* MIT Licensed
+*/
+
+/**
+* Module dependencies.
+*/
+
+var url = require('url');
+
+/**
+* Initialize a new `CookieJar`.
+*
+* @api private
+*/
+
+var CookieJar = exports = module.exports = function CookieJar() {
+  this.cookies = [];
+};
+
+/**
+* Add the given `cookie` to the jar.
+*
+* @param {Cookie} cookie
+* @api private
+*/
+
+CookieJar.prototype.add = function(cookie){
+  this.cookies = this.cookies.filter(function(c){
+    // Avoid duplication (same path, same name)
+    return !(c.name == cookie.name && c.path == cookie.path);
+  });
+  this.cookies.push(cookie);
+};
+
+/**
+* Get cookies for the given `req`.
+*
+* @param {IncomingRequest} req
+* @return {Array}
+* @api private
+*/
+
+CookieJar.prototype.get = function(req){
+  var path = url.parse(req.url).pathname
+    , now = new Date
+    , specificity = {};
+  return this.cookies.filter(function(cookie){
+    if (0 == path.indexOf(cookie.path) && now < cookie.expires
+      && cookie.path.length > (specificity[cookie.name] || 0))
+      return specificity[cookie.name] = cookie.path.length;
+  });
+};
+
+/**
+* Return Cookie string for the given `req`.
+*
+* @param {IncomingRequest} req
+* @return {String}
+* @api private
+*/
+
+CookieJar.prototype.cookieString = function(req){
+  var cookies = this.get(req);
+  if (cookies.length) {
+    return cookies.map(function(cookie){
+      return cookie.name + '=' + cookie.value;
+    }).join('; ');
+  }
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/package.json	(revision 487)
@@ -0,0 +1,31 @@
+{
+  "author": {
+    "name": "Mikeal Rogers",
+    "email": "mikeal.rogers@gmail.com",
+    "url": "http://www.futurealoof.com"
+  },
+  "name": "cookie-jar",
+  "description": "Cookie Jar. Originally pulled form tobi, maintained as vendor in request, now a standalone module.",
+  "version": "0.3.0",
+  "repository": {
+    "url": "https://github.com/mikeal/cookie-jar"
+  },
+  "main": "index.js",
+  "scripts": {
+    "test": "node tests/run.js"
+  },
+  "dependencies": {},
+  "devDependencies": {},
+  "optionalDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "readme": "cookie-jar\n==========\n\nCookie Jar. Originally pulled from LearnBoost/tobi, maintained as vendor in request, now a standalone module.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/mikeal/cookie-jar/issues"
+  },
+  "homepage": "https://github.com/mikeal/cookie-jar",
+  "_id": "cookie-jar@0.3.0",
+  "_from": "cookie-jar@~0.3.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/run.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/run.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/run.js	(revision 487)
@@ -0,0 +1,40 @@
+var spawn = require('child_process').spawn
+  , exitCode = 0
+  , timeout = 10000
+  , fs = require('fs')
+  ;
+
+fs.readdir(__dirname, function (e, files) {
+  if (e) throw e
+
+  var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'})
+
+  var next = function () {
+    if (tests.length === 0) process.exit(exitCode);
+
+    var file = tests.shift()
+    console.log(file)
+    var proc = spawn('node', [ 'tests/' + file ])
+
+    var killed = false
+    var t = setTimeout(function () {
+      proc.kill()
+      exitCode += 1
+      console.error(file + ' timeout')
+      killed = true
+    }, timeout)
+
+    proc.stdout.pipe(process.stdout)
+    proc.stderr.pipe(process.stderr)
+    proc.on('exit', function (code) {
+      if (code && !killed) console.error(file + ' failed')
+      exitCode += code || 0
+      clearTimeout(t)
+      next()
+    })
+  }
+  next()
+    
+})
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/test-cookie.js	(revision 487)
@@ -0,0 +1,29 @@
+var Cookie = require('../index')
+  , assert = require('assert');
+
+var str = 'Sid="s543qactge.wKE61E01Bs%2BKhzmxrwrnug="; Path=/; httpOnly; Expires=Sat, 04 Dec 2010 23:27:28 GMT';
+var cookie = new Cookie(str);
+
+// test .toString()
+assert.equal(cookie.toString(), str);
+
+// test .path
+assert.equal(cookie.path, '/');
+
+// test .httpOnly
+assert.equal(cookie.httpOnly, true);
+
+// test .name
+assert.equal(cookie.name, 'Sid');
+
+// test .value
+assert.equal(cookie.value, '"s543qactge.wKE61E01Bs%2BKhzmxrwrnug="');
+
+// test .expires
+assert.equal(cookie.expires instanceof Date, true);
+
+// test .path default
+var cookie = new Cookie('foo=bar', { url: 'http://foo.com/bar' });
+assert.equal(cookie.path, '/bar');
+
+console.log('All tests passed');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/cookie-jar/tests/test-cookiejar.js	(revision 487)
@@ -0,0 +1,90 @@
+var Cookie = require('../index')
+  , Jar = Cookie.Jar
+  , assert = require('assert');
+
+function expires(ms) {
+  return new Date(Date.now() + ms).toUTCString();
+}
+
+// test .get() expiration
+(function() {
+  var jar = new Jar;
+  var cookie = new Cookie('sid=1234; path=/; expires=' + expires(1000));
+  jar.add(cookie);
+  setTimeout(function(){
+    var cookies = jar.get({ url: 'http://foo.com/foo' });
+    assert.equal(cookies.length, 1);
+    assert.equal(cookies[0], cookie);
+    setTimeout(function(){
+      var cookies = jar.get({ url: 'http://foo.com/foo' });
+      assert.equal(cookies.length, 0);
+    }, 1000);
+  }, 5);
+})();
+
+// test .get() path support
+(function() {
+  var jar = new Jar;
+  var a = new Cookie('sid=1234; path=/');
+  var b = new Cookie('sid=1111; path=/foo/bar');
+  var c = new Cookie('sid=2222; path=/');
+  jar.add(a);
+  jar.add(b);
+  jar.add(c);
+
+  // should remove the duplicates
+  assert.equal(jar.cookies.length, 2);
+
+  // same name, same path, latter prevails
+  var cookies = jar.get({ url: 'http://foo.com/' });
+  assert.equal(cookies.length, 1);
+  assert.equal(cookies[0], c);
+
+  // same name, diff path, path specifity prevails, latter prevails
+  var cookies = jar.get({ url: 'http://foo.com/foo/bar' });
+  assert.equal(cookies.length, 1);
+  assert.equal(cookies[0], b);
+
+  var jar = new Jar;
+  var a = new Cookie('sid=1111; path=/foo/bar');
+  var b = new Cookie('sid=1234; path=/');
+  jar.add(a);
+  jar.add(b);
+
+  var cookies = jar.get({ url: 'http://foo.com/foo/bar' });
+  assert.equal(cookies.length, 1);
+  assert.equal(cookies[0], a);
+
+  var cookies = jar.get({ url: 'http://foo.com/' });
+  assert.equal(cookies.length, 1);
+  assert.equal(cookies[0], b);
+
+  var jar = new Jar;
+  var a = new Cookie('sid=1111; path=/foo/bar');
+  var b = new Cookie('sid=3333; path=/foo/bar');
+  var c = new Cookie('pid=3333; path=/foo/bar');
+  var d = new Cookie('sid=2222; path=/foo/');
+  var e = new Cookie('sid=1234; path=/');
+  jar.add(a);
+  jar.add(b);
+  jar.add(c);
+  jar.add(d);
+  jar.add(e);
+
+  var cookies = jar.get({ url: 'http://foo.com/foo/bar' });
+  assert.equal(cookies.length, 2);
+  assert.equal(cookies[0], b);
+  assert.equal(cookies[1], c);
+
+  var cookies = jar.get({ url: 'http://foo.com/foo/' });
+  assert.equal(cookies.length, 1);
+  assert.equal(cookies[0], d);
+
+  var cookies = jar.get({ url: 'http://foo.com/' });
+  assert.equal(cookies.length, 1);
+  assert.equal(cookies[0], e);
+})();
+
+setTimeout(function() {
+  console.log('All tests passed');
+}, 1200);
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/LICENSE	(revision 487)
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/README.md	(revision 487)
@@ -0,0 +1,4 @@
+forever-agent
+=============
+
+HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/index.js	(revision 487)
@@ -0,0 +1,119 @@
+module.exports = ForeverAgent
+ForeverAgent.SSL = ForeverAgentSSL
+
+var util = require('util')
+  , Agent = require('http').Agent
+  , net = require('net')
+  , tls = require('tls')
+  , AgentSSL = require('https').Agent
+
+function ForeverAgent(options) {
+  var self = this
+  self.options = options || {}
+  self.requests = {}
+  self.sockets = {}
+  self.freeSockets = {}
+  self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
+  self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
+  self.on('free', function(socket, host, port) {
+    var name = host + ':' + port
+    if (self.requests[name] && self.requests[name].length) {
+      self.requests[name].shift().onSocket(socket)
+    } else if (self.sockets[name].length < self.minSockets) {
+      if (!self.freeSockets[name]) self.freeSockets[name] = []
+      self.freeSockets[name].push(socket)
+      
+      // if an error happens while we don't use the socket anyway, meh, throw the socket away
+      var onIdleError = function() {
+        socket.destroy()
+      }
+      socket._onIdleError = onIdleError
+      socket.on('error', onIdleError)
+    } else {
+      // If there are no pending requests just destroy the
+      // socket and it will get removed from the pool. This
+      // gets us out of timeout issues and allows us to
+      // default to Connection:keep-alive.
+      socket.destroy()
+    }
+  })
+
+}
+util.inherits(ForeverAgent, Agent)
+
+ForeverAgent.defaultMinSockets = 5
+
+
+ForeverAgent.prototype.createConnection = net.createConnection
+ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
+ForeverAgent.prototype.addRequest = function(req, host, port) {
+  var name = host + ':' + port
+  if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
+    var idleSocket = this.freeSockets[name].pop()
+    idleSocket.removeListener('error', idleSocket._onIdleError)
+    delete idleSocket._onIdleError
+    req._reusedSocket = true
+    req.onSocket(idleSocket)
+  } else {
+    this.addRequestNoreuse(req, host, port)
+  }
+}
+
+ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
+  if (this.sockets[name]) {
+    var index = this.sockets[name].indexOf(s)
+    if (index !== -1) {
+      this.sockets[name].splice(index, 1)
+    }
+  } else if (this.sockets[name] && this.sockets[name].length === 0) {
+    // don't leak
+    delete this.sockets[name]
+    delete this.requests[name]
+  }
+  
+  if (this.freeSockets[name]) {
+    var index = this.freeSockets[name].indexOf(s)
+    if (index !== -1) {
+      this.freeSockets[name].splice(index, 1)
+      if (this.freeSockets[name].length === 0) {
+        delete this.freeSockets[name]
+      }
+    }
+  }
+
+  if (this.requests[name] && this.requests[name].length) {
+    // If we have pending requests and a socket gets closed a new one
+    // needs to be created to take over in the pool for the one that closed.
+    this.createSocket(name, host, port).emit('free')
+  }
+}
+
+function ForeverAgentSSL (options) {
+  ForeverAgent.call(this, options)
+}
+util.inherits(ForeverAgentSSL, ForeverAgent)
+
+ForeverAgentSSL.prototype.createConnection = createConnectionSSL
+ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
+
+function createConnectionSSL (port, host, options) {
+  if (typeof port === 'object') {
+    options = port;
+  } else if (typeof host === 'object') {
+    options = host;
+  } else if (typeof options === 'object') {
+    options = options;
+  } else {
+    options = {};
+  }
+
+  if (typeof port === 'number') {
+    options.port = port;
+  }
+
+  if (typeof host === 'string') {
+    options.host = host;
+  }
+
+  return tls.connect(options);
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/forever-agent/package.json	(revision 487)
@@ -0,0 +1,32 @@
+{
+  "author": {
+    "name": "Mikeal Rogers",
+    "email": "mikeal.rogers@gmail.com",
+    "url": "http://www.futurealoof.com"
+  },
+  "name": "forever-agent",
+  "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.",
+  "version": "0.5.2",
+  "repository": {
+    "url": "https://github.com/mikeal/forever-agent"
+  },
+  "main": "index.js",
+  "dependencies": {},
+  "devDependencies": {},
+  "optionalDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/mikeal/forever-agent/issues"
+  },
+  "homepage": "https://github.com/mikeal/forever-agent",
+  "_id": "forever-agent@0.5.2",
+  "dist": {
+    "shasum": "30e8bcea70478fa57599fc40b09a4a45c0710443"
+  },
+  "_from": "forever-agent@~0.5.0",
+  "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.5.2.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/License
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/License	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/License	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2012 Felix GeisendÃ¶rfer (felix@debuggable.com) and contributors
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/Readme.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/Readme.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/Readme.md	(revision 487)
@@ -0,0 +1,163 @@
+# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)
+
+A module to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications.
+
+The API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].
+
+[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
+[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
+
+## Install
+
+```
+npm install form-data
+```
+
+## Usage
+
+In this example we are constructing a form with 3 fields that contain a string,
+a buffer and a file stream.
+
+``` javascript
+var FormData = require('form-data');
+var fs = require('fs');
+
+var form = new FormData();
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_file', fs.createReadStream('/foo/bar.jpg'));
+```
+
+Also you can use http-response stream:
+
+``` javascript
+var FormData = require('form-data');
+var http = require('http');
+
+var form = new FormData();
+
+http.request('http://nodejs.org/images/logo.png', function(response) {
+  form.append('my_field', 'my value');
+  form.append('my_buffer', new Buffer(10));
+  form.append('my_logo', response);
+});
+```
+
+Or @mikeal's request stream:
+
+``` javascript
+var FormData = require('form-data');
+var request = require('request');
+
+var form = new FormData();
+
+form.append('my_field', 'my value');
+form.append('my_buffer', new Buffer(10));
+form.append('my_logo', request('http://nodejs.org/images/logo.png'));
+```
+
+In order to submit this form to a web application, call ```submit(url, [callback])``` method:
+
+``` javascript
+form.submit('http://example.org/', function(err, res) {
+  // res â response object (http.IncomingMessage)  //
+  res.resume(); // for node-0.10.x
+});
+
+```
+
+For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.
+
+### Alternative submission methods
+
+You can use node's http client interface:
+
+``` javascript
+var http = require('http');
+
+var request = http.request({
+  method: 'post',
+  host: 'example.org',
+  path: '/upload',
+  headers: form.getHeaders()
+});
+
+form.pipe(request);
+
+request.on('response', function(res) {
+  console.log(res.statusCode);
+});
+```
+
+Or if you would prefer the `'Content-Length'` header to be set for you:
+
+``` javascript
+form.submit('example.org/upload', function(err, res) {
+  console.log(res.statusCode);
+});
+```
+
+To use custom headers and pre-known length in parts:
+
+``` javascript
+var CRLF = '\r\n';
+var form = new FormData();
+
+var options = {
+  header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
+  knownLength: 1
+};
+
+form.append('my_buffer', buffer, options);
+
+form.submit('http://example.com/', function(err, res) {
+  if (err) throw err;
+  console.log('Done');
+});
+```
+
+Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually:
+
+``` javascript
+someModule.stream(function(err, stdout, stderr) {
+  if (err) throw err;
+
+  var form = new FormData();
+
+  form.append('file', stdout, {
+    filename: 'unicycle.jpg',
+    contentType: 'image/jpg',
+    knownLength: 19806
+  });
+
+  form.submit('http://example.com/', function(err, res) {
+    if (err) throw err;
+    console.log('Done');
+  });
+});
+```
+
+For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:
+
+``` javascript
+form.submit({
+  host: 'example.com',
+  path: '/probably.php?extra=params',
+  auth: 'username:password'
+}, function(err, res) {
+  console.log(res.statusCode);
+});
+```
+
+## Notes
+
+- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.
+- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]
+
+## TODO
+
+- Add new streams (0.10) support and try really hard not to break it for 0.8.x.
+
+## License
+
+Form-Data is licensed under the MIT license.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/lib/form_data.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/lib/form_data.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/lib/form_data.js	(revision 487)
@@ -0,0 +1,325 @@
+var CombinedStream = require('combined-stream');
+var util = require('util');
+var path = require('path');
+var http = require('http');
+var https = require('https');
+var parseUrl = require('url').parse;
+var fs = require('fs');
+var mime = require('mime');
+var async = require('async');
+
+module.exports = FormData;
+function FormData() {
+  this._overheadLength = 0;
+  this._valueLength = 0;
+  this._lengthRetrievers = [];
+
+  CombinedStream.call(this);
+}
+util.inherits(FormData, CombinedStream);
+
+FormData.LINE_BREAK = '\r\n';
+
+FormData.prototype.append = function(field, value, options) {
+  options = options || {};
+
+  var append = CombinedStream.prototype.append.bind(this);
+
+  // all that streamy business can't handle numbers
+  if (typeof value == 'number') value = ''+value;
+
+  // https://github.com/felixge/node-form-data/issues/38
+  if (util.isArray(value)) {
+    // Please convert your array into string
+    // the way web server expects it
+    this._error(new Error('Arrays are not supported.'));
+    return;
+  }
+
+  var header = this._multiPartHeader(field, value, options);
+  var footer = this._multiPartFooter(field, value, options);
+
+  append(header);
+  append(value);
+  append(footer);
+
+  // pass along options.knownLength
+  this._trackLength(header, value, options);
+};
+
+FormData.prototype._trackLength = function(header, value, options) {
+  var valueLength = 0;
+
+  // used w/ getLengthSync(), when length is known.
+  // e.g. for streaming directly from a remote server,
+  // w/ a known file a size, and not wanting to wait for
+  // incoming file to finish to get its size.
+  if (options.knownLength != null) {
+    valueLength += +options.knownLength;
+  } else if (Buffer.isBuffer(value)) {
+    valueLength = value.length;
+  } else if (typeof value === 'string') {
+    valueLength = Buffer.byteLength(value);
+  }
+
+  this._valueLength += valueLength;
+
+  // @check why add CRLF? does this account for custom/multiple CRLFs?
+  this._overheadLength +=
+    Buffer.byteLength(header) +
+    + FormData.LINE_BREAK.length;
+
+  // empty or either doesn't have path or not an http response
+  if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
+    return;
+  }
+
+  // no need to bother with the length
+  if (!options.knownLength)
+  this._lengthRetrievers.push(function(next) {
+
+    if (value.hasOwnProperty('fd')) {
+      fs.stat(value.path, function(err, stat) {
+        if (err) {
+          next(err);
+          return;
+        }
+
+        next(null, stat.size);
+      });
+
+    // or http response
+    } else if (value.hasOwnProperty('httpVersion')) {
+      next(null, +value.headers['content-length']);
+
+    // or request stream http://github.com/mikeal/request
+    } else if (value.hasOwnProperty('httpModule')) {
+      // wait till response come back
+      value.on('response', function(response) {
+        value.pause();
+        next(null, +response.headers['content-length']);
+      });
+      value.resume();
+
+    // something else
+    } else {
+      next('Unknown stream');
+    }
+  });
+};
+
+FormData.prototype._multiPartHeader = function(field, value, options) {
+  var boundary = this.getBoundary();
+  var header = '';
+
+  // custom header specified (as string)?
+  // it becomes responsible for boundary
+  // (e.g. to handle extra CRLFs on .NET servers)
+  if (options.header != null) {
+    header = options.header;
+  } else {
+    header += '--' + boundary + FormData.LINE_BREAK +
+      'Content-Disposition: form-data; name="' + field + '"';
+
+    // fs- and request- streams have path property
+    // or use custom filename and/or contentType
+    // TODO: Use request's response mime-type
+    if (options.filename || value.path) {
+      header +=
+        '; filename="' + path.basename(options.filename || value.path) + '"' + FormData.LINE_BREAK +
+        'Content-Type: ' +  (options.contentType || mime.lookup(options.filename || value.path));
+
+    // http response has not
+    } else if (value.readable && value.hasOwnProperty('httpVersion')) {
+      header +=
+        '; filename="' + path.basename(value.client._httpMessage.path) + '"' + FormData.LINE_BREAK +
+        'Content-Type: ' + value.headers['content-type'];
+    }
+
+    header += FormData.LINE_BREAK + FormData.LINE_BREAK;
+  }
+
+  return header;
+};
+
+FormData.prototype._multiPartFooter = function(field, value, options) {
+  return function(next) {
+    var footer = FormData.LINE_BREAK;
+
+    var lastPart = (this._streams.length === 0);
+    if (lastPart) {
+      footer += this._lastBoundary();
+    }
+
+    next(footer);
+  }.bind(this);
+};
+
+FormData.prototype._lastBoundary = function() {
+  return '--' + this.getBoundary() + '--';
+};
+
+FormData.prototype.getHeaders = function(userHeaders) {
+  var formHeaders = {
+    'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
+  };
+
+  for (var header in userHeaders) {
+    formHeaders[header.toLowerCase()] = userHeaders[header];
+  }
+
+  return formHeaders;
+}
+
+FormData.prototype.getCustomHeaders = function(contentType) {
+    contentType = contentType ? contentType : 'multipart/form-data';
+
+    var formHeaders = {
+        'content-type': contentType + '; boundary=' + this.getBoundary(),
+        'content-length': this.getLengthSync()
+    };
+
+    return formHeaders;
+}
+
+FormData.prototype.getBoundary = function() {
+  if (!this._boundary) {
+    this._generateBoundary();
+  }
+
+  return this._boundary;
+};
+
+FormData.prototype._generateBoundary = function() {
+  // This generates a 50 character boundary similar to those used by Firefox.
+  // They are optimized for boyer-moore parsing.
+  var boundary = '--------------------------';
+  for (var i = 0; i < 24; i++) {
+    boundary += Math.floor(Math.random() * 10).toString(16);
+  }
+
+  this._boundary = boundary;
+};
+
+// Note: getLengthSync DOESN'T calculate streams length
+// As workaround one can calculate file size manually
+// and add it as knownLength option
+FormData.prototype.getLengthSync = function(debug) {
+  var knownLength = this._overheadLength + this._valueLength;
+
+  // Don't get confused, there are 3 "internal" streams for each keyval pair
+  // so it basically checks if there is any value added to the form
+  if (this._streams.length) {
+    knownLength += this._lastBoundary().length;
+  }
+
+  // https://github.com/felixge/node-form-data/issues/40
+  if (this._lengthRetrievers.length) {
+    // Some async length retrivers are present
+    // therefore synchronous length calculation is false.
+    // Please use getLength(callback) to get proper length
+    this._error(new Error('Cannot calculate proper length in synchronous way.'));
+  }
+
+  return knownLength;
+};
+
+FormData.prototype.getLength = function(cb) {
+  var knownLength = this._overheadLength + this._valueLength;
+
+  if (this._streams.length) {
+    knownLength += this._lastBoundary().length;
+  }
+
+  if (!this._lengthRetrievers.length) {
+    process.nextTick(cb.bind(this, null, knownLength));
+    return;
+  }
+
+  async.parallel(this._lengthRetrievers, function(err, values) {
+    if (err) {
+      cb(err);
+      return;
+    }
+
+    values.forEach(function(length) {
+      knownLength += length;
+    });
+
+    cb(null, knownLength);
+  });
+};
+
+FormData.prototype.submit = function(params, cb) {
+
+  var request
+    , options
+    , defaults = {
+        method : 'post',
+        headers: this.getHeaders()
+    };
+
+  // parse provided url if it's string
+  // or treat it as options object
+  if (typeof params == 'string') {
+    params = parseUrl(params);
+
+    options = populate({
+      port: params.port,
+      path: params.pathname,
+      host: params.hostname
+    }, defaults);
+  }
+  else // use custom params
+  {
+    options = populate(params, defaults);
+    // if no port provided use default one
+    if (!options.port) {
+      options.port = options.protocol == 'https:' ? 443 : 80;
+    }
+  }
+
+  // https if specified, fallback to http in any other case
+  if (params.protocol == 'https:') {
+    request = https.request(options);
+  } else {
+    request = http.request(options);
+  }
+
+  // get content length and fire away
+  this.getLength(function(err, length) {
+
+    // TODO: Add chunked encoding when no length (if err)
+
+    // add content length
+    request.setHeader('Content-Length', length);
+
+    this.pipe(request);
+    if (cb) {
+      request.on('error', cb);
+      request.on('response', cb.bind(this, null));
+    }
+  }.bind(this));
+
+  return request;
+};
+
+FormData.prototype._error = function(err) {
+  if (this.error) return;
+
+  this.error = err;
+  this.pause();
+  this.emit('error', err);
+};
+
+/*
+ * Santa's little helpers
+ */
+
+// populates missing values
+function populate(dst, src) {
+  for (var prop in src) {
+    if (!dst[prop]) dst[prop] = src[prop];
+  }
+  return dst;
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/LICENSE	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/README.md	(revision 487)
@@ -0,0 +1,1425 @@
+# Async.js
+
+Async is a utility module which provides straight-forward, powerful functions
+for working with asynchronous JavaScript. Although originally designed for
+use with [node.js](http://nodejs.org), it can also be used directly in the
+browser. Also supports [component](https://github.com/component/component).
+
+Async provides around 20 functions that include the usual 'functional'
+suspects (map, reduce, filter, eachâŠ) as well as some common patterns
+for asynchronous control flow (parallel, series, waterfallâŠ). All these
+functions assume you follow the node.js convention of providing a single
+callback as the last argument of your async function.
+
+
+## Quick Examples
+
+```javascript
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+    // results is now an array of stats for each file
+});
+
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+    // results now equals an array of the existing files
+});
+
+async.parallel([
+    function(){ ... },
+    function(){ ... }
+], callback);
+
+async.series([
+    function(){ ... },
+    function(){ ... }
+]);
+```
+
+There are many more functions available so take a look at the docs below for a
+full list. This module aims to be comprehensive, so if you feel anything is
+missing please create a GitHub issue for it.
+
+## Common Pitfalls
+
+### Binding a context to an iterator
+
+This section is really about bind, not about async. If you are wondering how to
+make async execute your iterators in a given context, or are confused as to why
+a method of another library isn't working as an iterator, study this example:
+
+```js
+// Here is a simple object with an (unnecessarily roundabout) squaring method
+var AsyncSquaringLibrary = {
+  squareExponent: 2,
+  square: function(number, callback){ 
+    var result = Math.pow(number, this.squareExponent);
+    setTimeout(function(){
+      callback(null, result);
+    }, 200);
+  }
+};
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
+  // result is [NaN, NaN, NaN]
+  // This fails because the `this.squareExponent` expression in the square
+  // function is not evaluated in the context of AsyncSquaringLibrary, and is
+  // therefore undefined.
+});
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
+  // result is [1, 4, 9]
+  // With the help of bind we can attach a context to the iterator before
+  // passing it to async. Now the square function will be executed in its 
+  // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
+  // will be as expected.
+});
+```
+
+## Download
+
+The source is available for download from
+[GitHub](http://github.com/caolan/async).
+Alternatively, you can install using Node Package Manager (npm):
+
+    npm install async
+
+__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
+
+## In the Browser
+
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
+
+```html
+<script type="text/javascript" src="async.js"></script>
+<script type="text/javascript">
+
+    async.map(data, asyncProcess, function(err, results){
+        alert(results);
+    });
+
+</script>
+```
+
+## Documentation
+
+### Collections
+
+* [each](#each)
+* [eachSeries](#eachSeries)
+* [eachLimit](#eachLimit)
+* [map](#map)
+* [mapSeries](#mapSeries)
+* [mapLimit](#mapLimit)
+* [filter](#filter)
+* [filterSeries](#filterSeries)
+* [reject](#reject)
+* [rejectSeries](#rejectSeries)
+* [reduce](#reduce)
+* [reduceRight](#reduceRight)
+* [detect](#detect)
+* [detectSeries](#detectSeries)
+* [sortBy](#sortBy)
+* [some](#some)
+* [every](#every)
+* [concat](#concat)
+* [concatSeries](#concatSeries)
+
+### Control Flow
+
+* [series](#series)
+* [parallel](#parallel)
+* [parallelLimit](#parallellimittasks-limit-callback)
+* [whilst](#whilst)
+* [doWhilst](#doWhilst)
+* [until](#until)
+* [doUntil](#doUntil)
+* [forever](#forever)
+* [waterfall](#waterfall)
+* [compose](#compose)
+* [applyEach](#applyEach)
+* [applyEachSeries](#applyEachSeries)
+* [queue](#queue)
+* [cargo](#cargo)
+* [auto](#auto)
+* [iterator](#iterator)
+* [apply](#apply)
+* [nextTick](#nextTick)
+* [times](#times)
+* [timesSeries](#timesSeries)
+
+### Utils
+
+* [memoize](#memoize)
+* [unmemoize](#unmemoize)
+* [log](#log)
+* [dir](#dir)
+* [noConflict](#noConflict)
+
+
+## Collections
+
+<a name="forEach" />
+<a name="each" />
+### each(arr, iterator, callback)
+
+Applies an iterator function to each item in an array, in parallel.
+The iterator is called with an item from the list and a callback for when it
+has finished. If the iterator passes an error to this callback, the main
+callback for the each function is immediately called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback(err) which must be called once it has 
+  completed. If no error has occured, the callback should be run without 
+  arguments or with an explicit null argument.
+* callback(err) - A callback which is called after all the iterator functions
+  have finished, or an error has occurred.
+
+__Example__
+
+```js
+// assuming openFiles is an array of file names and saveFile is a function
+// to save the modified contents of that file:
+
+async.each(openFiles, saveFile, function(err){
+    // if any of the saves produced an error, err would equal that error
+});
+```
+
+---------------------------------------
+
+<a name="forEachSeries" />
+<a name="eachSeries" />
+### eachSeries(arr, iterator, callback)
+
+The same as each only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. This means the iterator functions will complete in order.
+
+
+---------------------------------------
+
+<a name="forEachLimit" />
+<a name="eachLimit" />
+### eachLimit(arr, limit, iterator, callback)
+
+The same as each only no more than "limit" iterators will be simultaneously 
+running at any time.
+
+Note that the items are not processed in batches, so there is no guarantee that
+ the first "limit" iterator functions will complete before any others are 
+started.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* limit - The maximum number of iterators to run at any time.
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback(err) which must be called once it has 
+  completed. If no error has occured, the callback should be run without 
+  arguments or with an explicit null argument.
+* callback(err) - A callback which is called after all the iterator functions
+  have finished, or an error has occurred.
+
+__Example__
+
+```js
+// Assume documents is an array of JSON objects and requestApi is a
+// function that interacts with a rate-limited REST api.
+
+async.eachLimit(documents, 20, requestApi, function(err){
+    // if any of the saves produced an error, err would equal that error
+});
+```
+
+---------------------------------------
+
+<a name="map" />
+### map(arr, iterator, callback)
+
+Produces a new array of values by mapping each value in the given array through
+the iterator function. The iterator is called with an item from the array and a
+callback for when it has finished processing. The callback takes 2 arguments, 
+an error and the transformed item from the array. If the iterator passes an
+error to this callback, the main callback for the map function is immediately
+called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order, however
+the results array will be in the same order as the original array.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback(err, transformed) which must be called once 
+  it has completed with an error (which can be null) and a transformed item.
+* callback(err, results) - A callback which is called after all the iterator
+  functions have finished, or an error has occurred. Results is an array of the
+  transformed items from the original array.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+    // results is now an array of stats for each file
+});
+```
+
+---------------------------------------
+
+<a name="mapSeries" />
+### mapSeries(arr, iterator, callback)
+
+The same as map only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+
+---------------------------------------
+
+<a name="mapLimit" />
+### mapLimit(arr, limit, iterator, callback)
+
+The same as map only no more than "limit" iterators will be simultaneously 
+running at any time.
+
+Note that the items are not processed in batches, so there is no guarantee that
+ the first "limit" iterator functions will complete before any others are 
+started.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* limit - The maximum number of iterators to run at any time.
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback(err, transformed) which must be called once 
+  it has completed with an error (which can be null) and a transformed item.
+* callback(err, results) - A callback which is called after all the iterator
+  functions have finished, or an error has occurred. Results is an array of the
+  transformed items from the original array.
+
+__Example__
+
+```js
+async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
+    // results is now an array of stats for each file
+});
+```
+
+---------------------------------------
+
+<a name="filter" />
+### filter(arr, iterator, callback)
+
+__Alias:__ select
+
+Returns a new array of all the values which pass an async truth test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like fs.exists. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+  The iterator is passed a callback(truthValue) which must be called with a 
+  boolean argument once it has completed.
+* callback(results) - A callback which is called after all the iterator
+  functions have finished.
+
+__Example__
+
+```js
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+    // results now equals an array of the existing files
+});
+```
+
+---------------------------------------
+
+<a name="filterSeries" />
+### filterSeries(arr, iterator, callback)
+
+__alias:__ selectSeries
+
+The same as filter only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+---------------------------------------
+
+<a name="reject" />
+### reject(arr, iterator, callback)
+
+The opposite of filter. Removes values that pass an async truth test.
+
+---------------------------------------
+
+<a name="rejectSeries" />
+### rejectSeries(arr, iterator, callback)
+
+The same as reject, only the iterator is applied to each item in the array
+in series.
+
+
+---------------------------------------
+
+<a name="reduce" />
+### reduce(arr, memo, iterator, callback)
+
+__aliases:__ inject, foldl
+
+Reduces a list of values into a single value using an async iterator to return
+each successive step. Memo is the initial state of the reduction. This
+function only operates in series. For performance reasons, it may make sense to
+split a call to this function into a parallel map, then use the normal
+Array.prototype.reduce on the results. This function is for situations where
+each step in the reduction needs to be async, if you can get the data before
+reducing it then it's probably a good idea to do so.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* memo - The initial state of the reduction.
+* iterator(memo, item, callback) - A function applied to each item in the
+  array to produce the next step in the reduction. The iterator is passed a
+  callback(err, reduction) which accepts an optional error as its first 
+  argument, and the state of the reduction as the second. If an error is 
+  passed to the callback, the reduction is stopped and the main callback is 
+  immediately called with the error.
+* callback(err, result) - A callback which is called after all the iterator
+  functions have finished. Result is the reduced value.
+
+__Example__
+
+```js
+async.reduce([1,2,3], 0, function(memo, item, callback){
+    // pointless async:
+    process.nextTick(function(){
+        callback(null, memo + item)
+    });
+}, function(err, result){
+    // result is now equal to the last value of memo, which is 6
+});
+```
+
+---------------------------------------
+
+<a name="reduceRight" />
+### reduceRight(arr, memo, iterator, callback)
+
+__Alias:__ foldr
+
+Same as reduce, only operates on the items in the array in reverse order.
+
+
+---------------------------------------
+
+<a name="detect" />
+### detect(arr, iterator, callback)
+
+Returns the first value in a list that passes an async truth test. The
+iterator is applied in parallel, meaning the first iterator to return true will
+fire the detect callback with that result. That means the result might not be
+the first item in the original array (in terms of order) that passes the test.
+
+If order within the original array is important then look at detectSeries.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+  The iterator is passed a callback(truthValue) which must be called with a 
+  boolean argument once it has completed.
+* callback(result) - A callback which is called as soon as any iterator returns
+  true, or after all the iterator functions have finished. Result will be
+  the first item in the array that passes the truth test (iterator) or the
+  value undefined if none passed.
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+    // result now equals the first file in the list that exists
+});
+```
+
+---------------------------------------
+
+<a name="detectSeries" />
+### detectSeries(arr, iterator, callback)
+
+The same as detect, only the iterator is applied to each item in the array
+in series. This means the result is always the first in the original array (in
+terms of array order) that passes the truth test.
+
+
+---------------------------------------
+
+<a name="sortBy" />
+### sortBy(arr, iterator, callback)
+
+Sorts a list by the results of running each value through an async iterator.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback(err, sortValue) which must be called once it
+  has completed with an error (which can be null) and a value to use as the sort
+  criteria.
+* callback(err, results) - A callback which is called after all the iterator
+  functions have finished, or an error has occurred. Results is the items from
+  the original array sorted by the values returned by the iterator calls.
+
+__Example__
+
+```js
+async.sortBy(['file1','file2','file3'], function(file, callback){
+    fs.stat(file, function(err, stats){
+        callback(err, stats.mtime);
+    });
+}, function(err, results){
+    // results is now the original array of files sorted by
+    // modified date
+});
+```
+
+---------------------------------------
+
+<a name="some" />
+### some(arr, iterator, callback)
+
+__Alias:__ any
+
+Returns true if at least one element in the array satisfies an async test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like fs.exists. Once any iterator
+call returns true, the main callback is immediately called.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+  The iterator is passed a callback(truthValue) which must be called with a 
+  boolean argument once it has completed.
+* callback(result) - A callback which is called as soon as any iterator returns
+  true, or after all the iterator functions have finished. Result will be
+  either true or false depending on the values of the async tests.
+
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+    // if result is true then at least one of the files exists
+});
+```
+
+---------------------------------------
+
+<a name="every" />
+### every(arr, iterator, callback)
+
+__Alias:__ all
+
+Returns true if every element in the array satisfies an async test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like fs.exists.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+  The iterator is passed a callback(truthValue) which must be called with a 
+  boolean argument once it has completed.
+* callback(result) - A callback which is called after all the iterator
+  functions have finished. Result will be either true or false depending on
+  the values of the async tests.
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+    // if result is true then every file exists
+});
+```
+
+---------------------------------------
+
+<a name="concat" />
+### concat(arr, iterator, callback)
+
+Applies an iterator to each item in a list, concatenating the results. Returns the
+concatenated list. The iterators are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of the arguments passed to the iterator function.
+
+__Arguments__
+
+* arr - An array to iterate over
+* iterator(item, callback) - A function to apply to each item in the array.
+  The iterator is passed a callback(err, results) which must be called once it 
+  has completed with an error (which can be null) and an array of results.
+* callback(err, results) - A callback which is called after all the iterator
+  functions have finished, or an error has occurred. Results is an array containing
+  the concatenated results of the iterator function.
+
+__Example__
+
+```js
+async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+    // files is now a list of filenames that exist in the 3 directories
+});
+```
+
+---------------------------------------
+
+<a name="concatSeries" />
+### concatSeries(arr, iterator, callback)
+
+Same as async.concat, but executes in series instead of parallel.
+
+
+## Control Flow
+
+<a name="series" />
+### series(tasks, [callback])
+
+Run an array of functions in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run and the callback for the series is
+immediately called with the value of the error. Once the tasks have completed,
+the results are passed to the final callback as an array.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final callback as an object
+instead of an array. This can be a more readable way of handling results from
+async.series.
+
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed
+  a callback(err, result) it must call on completion with an error (which can
+  be null) and an optional result value.
+* callback(err, results) - An optional callback to run once all the functions
+  have completed. This function gets a results array (or object) containing all 
+  the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.series([
+    function(callback){
+        // do some stuff ...
+        callback(null, 'one');
+    },
+    function(callback){
+        // do some more stuff ...
+        callback(null, 'two');
+    }
+],
+// optional callback
+function(err, results){
+    // results is now equal to ['one', 'two']
+});
+
+
+// an example using an object instead of an array
+async.series({
+    one: function(callback){
+        setTimeout(function(){
+            callback(null, 1);
+        }, 200);
+    },
+    two: function(callback){
+        setTimeout(function(){
+            callback(null, 2);
+        }, 100);
+    }
+},
+function(err, results) {
+    // results is now equal to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+<a name="parallel" />
+### parallel(tasks, [callback])
+
+Run an array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main callback is immediately called with the value of the error.
+Once the tasks have completed, the results are passed to the final callback as an
+array.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final callback as an object
+instead of an array. This can be a more readable way of handling results from
+async.parallel.
+
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed 
+  a callback(err, result) it must call on completion with an error (which can
+  be null) and an optional result value.
+* callback(err, results) - An optional callback to run once all the functions
+  have completed. This function gets a results array (or object) containing all 
+  the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.parallel([
+    function(callback){
+        setTimeout(function(){
+            callback(null, 'one');
+        }, 200);
+    },
+    function(callback){
+        setTimeout(function(){
+            callback(null, 'two');
+        }, 100);
+    }
+],
+// optional callback
+function(err, results){
+    // the results array will equal ['one','two'] even though
+    // the second function had a shorter timeout.
+});
+
+
+// an example using an object instead of an array
+async.parallel({
+    one: function(callback){
+        setTimeout(function(){
+            callback(null, 1);
+        }, 200);
+    },
+    two: function(callback){
+        setTimeout(function(){
+            callback(null, 2);
+        }, 100);
+    }
+},
+function(err, results) {
+    // results is now equals to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+<a name="parallel" />
+### parallelLimit(tasks, limit, [callback])
+
+The same as parallel only the tasks are executed in parallel with a maximum of "limit" 
+tasks executing at any time.
+
+Note that the tasks are not executed in batches, so there is no guarantee that 
+the first "limit" tasks will complete before any others are started.
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed 
+  a callback(err, result) it must call on completion with an error (which can
+  be null) and an optional result value.
+* limit - The maximum number of tasks to run at any time.
+* callback(err, results) - An optional callback to run once all the functions
+  have completed. This function gets a results array (or object) containing all 
+  the result arguments passed to the task callbacks.
+
+---------------------------------------
+
+<a name="whilst" />
+### whilst(test, fn, callback)
+
+Repeatedly call fn, while test returns true. Calls the callback when stopped,
+or an error occurs.
+
+__Arguments__
+
+* test() - synchronous truth test to perform before each execution of fn.
+* fn(callback) - A function to call each time the test passes. The function is
+  passed a callback(err) which must be called once it has completed with an 
+  optional error argument.
+* callback(err) - A callback which is called after the test fails and repeated
+  execution of fn has stopped.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+    function () { return count < 5; },
+    function (callback) {
+        count++;
+        setTimeout(callback, 1000);
+    },
+    function (err) {
+        // 5 seconds have passed
+    }
+);
+```
+
+---------------------------------------
+
+<a name="doWhilst" />
+### doWhilst(fn, test, callback)
+
+The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+
+---------------------------------------
+
+<a name="until" />
+### until(test, fn, callback)
+
+Repeatedly call fn, until test returns true. Calls the callback when stopped,
+or an error occurs.
+
+The inverse of async.whilst.
+
+---------------------------------------
+
+<a name="doUntil" />
+### doUntil(fn, test, callback)
+
+Like doWhilst except the test is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+<a name="forever" />
+### forever(fn, callback)
+
+Calls the asynchronous function 'fn' repeatedly, in series, indefinitely.
+If an error is passed to fn's callback then 'callback' is called with the
+error, otherwise it will never be called.
+
+---------------------------------------
+
+<a name="waterfall" />
+### waterfall(tasks, [callback])
+
+Runs an array of functions in series, each passing their results to the next in
+the array. However, if any of the functions pass an error to the callback, the
+next function is not executed and the main callback is immediately called with
+the error.
+
+__Arguments__
+
+* tasks - An array of functions to run, each function is passed a 
+  callback(err, result1, result2, ...) it must call on completion. The first
+  argument is an error (which can be null) and any further arguments will be 
+  passed as arguments in order to the next task.
+* callback(err, [results]) - An optional callback to run once all the functions
+  have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+```js
+async.waterfall([
+    function(callback){
+        callback(null, 'one', 'two');
+    },
+    function(arg1, arg2, callback){
+        callback(null, 'three');
+    },
+    function(arg1, callback){
+        // arg1 now equals 'three'
+        callback(null, 'done');
+    }
+], function (err, result) {
+   // result now equals 'done'    
+});
+```
+
+---------------------------------------
+<a name="compose" />
+### compose(fn1, fn2...)
+
+Creates a function which is a composition of the passed asynchronous
+functions. Each function consumes the return value of the function that
+follows. Composing functions f(), g() and h() would produce the result of
+f(g(h())), only this version uses callbacks to obtain the return values.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* functions... - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+function add1(n, callback) {
+    setTimeout(function () {
+        callback(null, n + 1);
+    }, 10);
+}
+
+function mul3(n, callback) {
+    setTimeout(function () {
+        callback(null, n * 3);
+    }, 10);
+}
+
+var add1mul3 = async.compose(mul3, add1);
+
+add1mul3(4, function (err, result) {
+   // result now equals 15
+});
+```
+
+---------------------------------------
+<a name="applyEach" />
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling the
+callback after all functions have completed. If you only provide the first
+argument then it will return a function which lets you pass in the
+arguments as if it were a single function call.
+
+__Arguments__
+
+* fns - the asynchronous functions to all call with the same arguments
+* args... - any number of separate arguments to pass to the function
+* callback - the final argument should be the callback, called when all
+  functions have completed processing
+
+
+__Example__
+
+```js
+async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+
+// partial application example:
+async.each(
+    buckets,
+    async.applyEach([enableSearch, updateSchema]),
+    callback
+);
+```
+
+---------------------------------------
+
+<a name="applyEachSeries" />
+### applyEachSeries(arr, iterator, callback)
+
+The same as applyEach only the functions are applied in series.
+
+---------------------------------------
+
+<a name="queue" />
+### queue(worker, concurrency)
+
+Creates a queue object with the specified concurrency. Tasks added to the
+queue will be processed in parallel (up to the concurrency limit). If all
+workers are in progress, the task is queued until one is available. Once
+a worker has completed a task, the task's callback is called.
+
+__Arguments__
+
+* worker(task, callback) - An asynchronous function for processing a queued
+  task, which must call its callback(err) argument when finished, with an 
+  optional error as an argument.
+* concurrency - An integer for determining how many worker functions should be
+  run in parallel.
+
+__Queue objects__
+
+The queue object returned by this function has the following properties and
+methods:
+
+* length() - a function returning the number of items waiting to be processed.
+* concurrency - an integer for determining how many worker functions should be
+  run in parallel. This property can be changed after a queue is created to
+  alter the concurrency on-the-fly.
+* push(task, [callback]) - add a new task to the queue, the callback is called
+  once the worker has finished processing the task.
+  instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
+* unshift(task, [callback]) - add a new task to the front of the queue.
+* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
+* empty - a callback that is called when the last item from the queue is given to a worker
+* drain - a callback that is called when the last item from the queue has returned from the worker
+
+__Example__
+
+```js
+// create a queue object with concurrency 2
+
+var q = async.queue(function (task, callback) {
+    console.log('hello ' + task.name);
+    callback();
+}, 2);
+
+
+// assign a callback
+q.drain = function() {
+    console.log('all items have been processed');
+}
+
+// add some items to the queue
+
+q.push({name: 'foo'}, function (err) {
+    console.log('finished processing foo');
+});
+q.push({name: 'bar'}, function (err) {
+    console.log('finished processing bar');
+});
+
+// add some items to the queue (batch-wise)
+
+q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+    console.log('finished processing bar');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+    console.log('finished processing bar');
+});
+```
+
+---------------------------------------
+
+<a name="cargo" />
+### cargo(worker, [payload])
+
+Creates a cargo object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the payload limit). If the
+worker is in progress, the task is queued until it is available. Once
+the worker has completed some tasks, each callback of those tasks is called.
+
+__Arguments__
+
+* worker(tasks, callback) - An asynchronous function for processing an array of
+  queued tasks, which must call its callback(err) argument when finished, with 
+  an optional error as an argument.
+* payload - An optional integer for determining how many tasks should be
+  processed per round; if omitted, the default is unlimited.
+
+__Cargo objects__
+
+The cargo object returned by this function has the following properties and
+methods:
+
+* length() - a function returning the number of items waiting to be processed.
+* payload - an integer for determining how many tasks should be
+  process per round. This property can be changed after a cargo is created to
+  alter the payload on-the-fly.
+* push(task, [callback]) - add a new task to the queue, the callback is called
+  once the worker has finished processing the task.
+  instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
+* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
+* empty - a callback that is called when the last item from the queue is given to a worker
+* drain - a callback that is called when the last item from the queue has returned from the worker
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+    for(var i=0; i<tasks.length; i++){
+      console.log('hello ' + tasks[i].name);
+    }
+    callback();
+}, 2);
+
+
+// add some items
+
+cargo.push({name: 'foo'}, function (err) {
+    console.log('finished processing foo');
+});
+cargo.push({name: 'bar'}, function (err) {
+    console.log('finished processing bar');
+});
+cargo.push({name: 'baz'}, function (err) {
+    console.log('finished processing baz');
+});
+```
+
+---------------------------------------
+
+<a name="auto" />
+### auto(tasks, [callback])
+
+Determines the best order for running functions based on their requirements.
+Each function can optionally depend on other functions being completed first,
+and each function is run as soon as its requirements are satisfied. If any of
+the functions pass an error to their callback, that function will not complete
+(so any other functions depending on it will not run) and the main callback
+will be called immediately with the error. Functions also receive an object
+containing the results of functions which have completed so far.
+
+Note, all functions are called with a results object as a second argument, 
+so it is unsafe to pass functions in the tasks object which cannot handle the
+extra argument. For example, this snippet of code:
+
+```js
+async.auto({
+  readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
+}, callback);
+```
+
+will have the effect of calling readFile with the results object as the last
+argument, which will fail:
+
+```js
+fs.readFile('data.txt', 'utf-8', cb, {});
+```
+
+Instead, wrap the call to readFile in a function which does not forward the 
+results object:
+
+```js
+async.auto({
+  readData: function(cb, results){
+    fs.readFile('data.txt', 'utf-8', cb);
+  }
+}, callback);
+```
+
+__Arguments__
+
+* tasks - An object literal containing named functions or an array of
+  requirements, with the function itself the last item in the array. The key
+  used for each function or array is used when specifying requirements. The 
+  function receives two arguments: (1) a callback(err, result) which must be 
+  called when finished, passing an error (which can be null) and the result of 
+  the function's execution, and (2) a results object, containing the results of
+  the previously executed functions.
+* callback(err, results) - An optional callback which is called when all the
+  tasks have been completed. The callback will receive an error as an argument
+  if any tasks pass an error to their callback. Results will always be passed
+	but if an error occurred, no other tasks will be performed, and the results
+	object will only contain partial results.
+  
+
+__Example__
+
+```js
+async.auto({
+    get_data: function(callback){
+        // async code to get some data
+    },
+    make_folder: function(callback){
+        // async code to create a directory to store a file in
+        // this is run at the same time as getting the data
+    },
+    write_file: ['get_data', 'make_folder', function(callback){
+        // once there is some data and the directory exists,
+        // write the data to a file in the directory
+        callback(null, filename);
+    }],
+    email_link: ['write_file', function(callback, results){
+        // once the file is written let's email a link to it...
+        // results.write_file contains the filename returned by write_file.
+    }]
+});
+```
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+```js
+async.parallel([
+    function(callback){
+        // async code to get some data
+    },
+    function(callback){
+        // async code to create a directory to store a file in
+        // this is run at the same time as getting the data
+    }
+],
+function(err, results){
+    async.series([
+        function(callback){
+            // once there is some data and the directory exists,
+            // write the data to a file in the directory
+        },
+        function(callback){
+            // once the file is written let's email a link to it...
+        }
+    ]);
+});
+```
+
+For a complicated series of async tasks using the auto function makes adding
+new tasks much easier and makes the code more readable.
+
+
+---------------------------------------
+
+<a name="iterator" />
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the array,
+returning a continuation to call the next one after that. It's also possible to
+'peek' the next iterator by doing iterator.next().
+
+This function is used internally by the async module but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* tasks - An array of functions to run.
+
+__Example__
+
+```js
+var iterator = async.iterator([
+    function(){ sys.p('one'); },
+    function(){ sys.p('two'); },
+    function(){ sys.p('three'); }
+]);
+
+node> var iterator2 = iterator();
+'one'
+node> var iterator3 = iterator2();
+'two'
+node> iterator3();
+'three'
+node> var nextfn = iterator2.next();
+node> nextfn();
+'three'
+```
+
+---------------------------------------
+
+<a name="apply" />
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied, a useful
+shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to automatically apply when the
+  continuation is called.
+
+__Example__
+
+```js
+// using apply
+
+async.parallel([
+    async.apply(fs.writeFile, 'testfile1', 'test1'),
+    async.apply(fs.writeFile, 'testfile2', 'test2'),
+]);
+
+
+// the same process without using apply
+
+async.parallel([
+    function(callback){
+        fs.writeFile('testfile1', 'test1', callback);
+    },
+    function(callback){
+        fs.writeFile('testfile2', 'test2', callback);
+    }
+]);
+```
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+```js
+node> var fn = async.apply(sys.puts, 'one');
+node> fn('two', 'three');
+one
+two
+three
+```
+
+---------------------------------------
+
+<a name="nextTick" />
+### nextTick(callback)
+
+Calls the callback on a later loop around the event loop. In node.js this just
+calls process.nextTick, in the browser it falls back to setImmediate(callback)
+if available, otherwise setTimeout(callback, 0), which means other higher priority
+events may precede the execution of the callback.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* callback - The function to call on a later loop around the event loop.
+
+__Example__
+
+```js
+var call_order = [];
+async.nextTick(function(){
+    call_order.push('two');
+    // call_order now equals ['one','two']
+});
+call_order.push('one')
+```
+
+<a name="times" />
+### times(n, callback)
+
+Calls the callback n times and accumulates results in the same manner
+you would use with async.map.
+
+__Arguments__
+
+* n - The number of times to run the function.
+* callback - The function to call n times.
+
+__Example__
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+  callback(null, {
+    id: 'user' + id
+  })
+}
+// generate 5 users
+async.times(5, function(n, next){
+    createUser(n, function(err, user) {
+      next(err, user)
+    })
+}, function(err, users) {
+  // we should now have 5 users
+});
+```
+
+<a name="timesSeries" />
+### timesSeries(n, callback)
+
+The same as times only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+
+## Utils
+
+<a name="memoize" />
+### memoize(fn, [hasher])
+
+Caches the results of an async function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* fn - the function you to proxy and cache results from.
+* hasher - an optional function for generating a custom hash for storing
+  results, it has all the arguments applied to it apart from the callback, and
+  must be synchronous.
+
+__Example__
+
+```js
+var slow_fn = function (name, callback) {
+    // do something
+    callback(null, result);
+};
+var fn = async.memoize(slow_fn);
+
+// fn can now be used as if it were slow_fn
+fn('some name', function () {
+    // callback
+});
+```
+
+<a name="unmemoize" />
+### unmemoize(fn)
+
+Undoes a memoized function, reverting it to the original, unmemoized
+form. Comes handy in tests.
+
+__Arguments__
+
+* fn - the memoized function
+
+<a name="log" />
+### log(function, arguments)
+
+Logs the result of an async function to the console. Only works in node.js or
+in browsers that support console.log and console.error (such as FF and Chrome).
+If multiple arguments are returned from the async function, console.log is
+called on each argument in order.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+    setTimeout(function(){
+        callback(null, 'hello ' + name);
+    }, 1000);
+};
+```
+```js
+node> async.log(hello, 'world');
+'hello world'
+```
+
+---------------------------------------
+
+<a name="dir" />
+### dir(function, arguments)
+
+Logs the result of an async function to the console using console.dir to
+display the properties of the resulting object. Only works in node.js or
+in browsers that support console.dir and console.error (such as FF and Chrome).
+If multiple arguments are returned from the async function, console.dir is
+called on each argument in order.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+    setTimeout(function(){
+        callback(null, {hello: name});
+    }, 1000);
+};
+```
+```js
+node> async.dir(hello, 'world');
+{hello: 'world'}
+```
+
+---------------------------------------
+
+<a name="noConflict" />
+### noConflict()
+
+Changes the value of async back to its original value, returning a reference to the
+async object.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/component.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/component.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/component.json	(revision 487)
@@ -0,0 +1,11 @@
+{
+  "name": "async",
+  "repo": "caolan/async",
+  "description": "Higher-order functions and common patterns for asynchronous code",
+  "version": "0.1.23",
+  "keywords": [],
+  "dependencies": {},
+  "development": {},
+  "main": "lib/async.js",
+  "scripts": [ "lib/async.js" ]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js	(revision 487)
@@ -0,0 +1,958 @@
+/*global setImmediate: false, setTimeout: false, console: false */
+(function () {
+
+    var async = {};
+
+    // global on the server, window in the browser
+    var root, previous_async;
+
+    root = this;
+    if (root != null) {
+      previous_async = root.async;
+    }
+
+    async.noConflict = function () {
+        root.async = previous_async;
+        return async;
+    };
+
+    function only_once(fn) {
+        var called = false;
+        return function() {
+            if (called) throw new Error("Callback was already called.");
+            called = true;
+            fn.apply(root, arguments);
+        }
+    }
+
+    //// cross-browser compatiblity functions ////
+
+    var _each = function (arr, iterator) {
+        if (arr.forEach) {
+            return arr.forEach(iterator);
+        }
+        for (var i = 0; i < arr.length; i += 1) {
+            iterator(arr[i], i, arr);
+        }
+    };
+
+    var _map = function (arr, iterator) {
+        if (arr.map) {
+            return arr.map(iterator);
+        }
+        var results = [];
+        _each(arr, function (x, i, a) {
+            results.push(iterator(x, i, a));
+        });
+        return results;
+    };
+
+    var _reduce = function (arr, iterator, memo) {
+        if (arr.reduce) {
+            return arr.reduce(iterator, memo);
+        }
+        _each(arr, function (x, i, a) {
+            memo = iterator(memo, x, i, a);
+        });
+        return memo;
+    };
+
+    var _keys = function (obj) {
+        if (Object.keys) {
+            return Object.keys(obj);
+        }
+        var keys = [];
+        for (var k in obj) {
+            if (obj.hasOwnProperty(k)) {
+                keys.push(k);
+            }
+        }
+        return keys;
+    };
+
+    //// exported async module functions ////
+
+    //// nextTick implementation with browser-compatible fallback ////
+    if (typeof process === 'undefined' || !(process.nextTick)) {
+        if (typeof setImmediate === 'function') {
+            async.nextTick = function (fn) {
+                // not a direct alias for IE10 compatibility
+                setImmediate(fn);
+            };
+            async.setImmediate = async.nextTick;
+        }
+        else {
+            async.nextTick = function (fn) {
+                setTimeout(fn, 0);
+            };
+            async.setImmediate = async.nextTick;
+        }
+    }
+    else {
+        async.nextTick = process.nextTick;
+        if (typeof setImmediate !== 'undefined') {
+            async.setImmediate = function (fn) {
+              // not a direct alias for IE10 compatibility
+              setImmediate(fn);
+            };
+        }
+        else {
+            async.setImmediate = async.nextTick;
+        }
+    }
+
+    async.each = function (arr, iterator, callback) {
+        callback = callback || function () {};
+        if (!arr.length) {
+            return callback();
+        }
+        var completed = 0;
+        _each(arr, function (x) {
+            iterator(x, only_once(function (err) {
+                if (err) {
+                    callback(err);
+                    callback = function () {};
+                }
+                else {
+                    completed += 1;
+                    if (completed >= arr.length) {
+                        callback(null);
+                    }
+                }
+            }));
+        });
+    };
+    async.forEach = async.each;
+
+    async.eachSeries = function (arr, iterator, callback) {
+        callback = callback || function () {};
+        if (!arr.length) {
+            return callback();
+        }
+        var completed = 0;
+        var iterate = function () {
+            iterator(arr[completed], function (err) {
+                if (err) {
+                    callback(err);
+                    callback = function () {};
+                }
+                else {
+                    completed += 1;
+                    if (completed >= arr.length) {
+                        callback(null);
+                    }
+                    else {
+                        iterate();
+                    }
+                }
+            });
+        };
+        iterate();
+    };
+    async.forEachSeries = async.eachSeries;
+
+    async.eachLimit = function (arr, limit, iterator, callback) {
+        var fn = _eachLimit(limit);
+        fn.apply(null, [arr, iterator, callback]);
+    };
+    async.forEachLimit = async.eachLimit;
+
+    var _eachLimit = function (limit) {
+
+        return function (arr, iterator, callback) {
+            callback = callback || function () {};
+            if (!arr.length || limit <= 0) {
+                return callback();
+            }
+            var completed = 0;
+            var started = 0;
+            var running = 0;
+
+            (function replenish () {
+                if (completed >= arr.length) {
+                    return callback();
+                }
+
+                while (running < limit && started < arr.length) {
+                    started += 1;
+                    running += 1;
+                    iterator(arr[started - 1], function (err) {
+                        if (err) {
+                            callback(err);
+                            callback = function () {};
+                        }
+                        else {
+                            completed += 1;
+                            running -= 1;
+                            if (completed >= arr.length) {
+                                callback();
+                            }
+                            else {
+                                replenish();
+                            }
+                        }
+                    });
+                }
+            })();
+        };
+    };
+
+
+    var doParallel = function (fn) {
+        return function () {
+            var args = Array.prototype.slice.call(arguments);
+            return fn.apply(null, [async.each].concat(args));
+        };
+    };
+    var doParallelLimit = function(limit, fn) {
+        return function () {
+            var args = Array.prototype.slice.call(arguments);
+            return fn.apply(null, [_eachLimit(limit)].concat(args));
+        };
+    };
+    var doSeries = function (fn) {
+        return function () {
+            var args = Array.prototype.slice.call(arguments);
+            return fn.apply(null, [async.eachSeries].concat(args));
+        };
+    };
+
+
+    var _asyncMap = function (eachfn, arr, iterator, callback) {
+        var results = [];
+        arr = _map(arr, function (x, i) {
+            return {index: i, value: x};
+        });
+        eachfn(arr, function (x, callback) {
+            iterator(x.value, function (err, v) {
+                results[x.index] = v;
+                callback(err);
+            });
+        }, function (err) {
+            callback(err, results);
+        });
+    };
+    async.map = doParallel(_asyncMap);
+    async.mapSeries = doSeries(_asyncMap);
+    async.mapLimit = function (arr, limit, iterator, callback) {
+        return _mapLimit(limit)(arr, iterator, callback);
+    };
+
+    var _mapLimit = function(limit) {
+        return doParallelLimit(limit, _asyncMap);
+    };
+
+    // reduce only has a series version, as doing reduce in parallel won't
+    // work in many situations.
+    async.reduce = function (arr, memo, iterator, callback) {
+        async.eachSeries(arr, function (x, callback) {
+            iterator(memo, x, function (err, v) {
+                memo = v;
+                callback(err);
+            });
+        }, function (err) {
+            callback(err, memo);
+        });
+    };
+    // inject alias
+    async.inject = async.reduce;
+    // foldl alias
+    async.foldl = async.reduce;
+
+    async.reduceRight = function (arr, memo, iterator, callback) {
+        var reversed = _map(arr, function (x) {
+            return x;
+        }).reverse();
+        async.reduce(reversed, memo, iterator, callback);
+    };
+    // foldr alias
+    async.foldr = async.reduceRight;
+
+    var _filter = function (eachfn, arr, iterator, callback) {
+        var results = [];
+        arr = _map(arr, function (x, i) {
+            return {index: i, value: x};
+        });
+        eachfn(arr, function (x, callback) {
+            iterator(x.value, function (v) {
+                if (v) {
+                    results.push(x);
+                }
+                callback();
+            });
+        }, function (err) {
+            callback(_map(results.sort(function (a, b) {
+                return a.index - b.index;
+            }), function (x) {
+                return x.value;
+            }));
+        });
+    };
+    async.filter = doParallel(_filter);
+    async.filterSeries = doSeries(_filter);
+    // select alias
+    async.select = async.filter;
+    async.selectSeries = async.filterSeries;
+
+    var _reject = function (eachfn, arr, iterator, callback) {
+        var results = [];
+        arr = _map(arr, function (x, i) {
+            return {index: i, value: x};
+        });
+        eachfn(arr, function (x, callback) {
+            iterator(x.value, function (v) {
+                if (!v) {
+                    results.push(x);
+                }
+                callback();
+            });
+        }, function (err) {
+            callback(_map(results.sort(function (a, b) {
+                return a.index - b.index;
+            }), function (x) {
+                return x.value;
+            }));
+        });
+    };
+    async.reject = doParallel(_reject);
+    async.rejectSeries = doSeries(_reject);
+
+    var _detect = function (eachfn, arr, iterator, main_callback) {
+        eachfn(arr, function (x, callback) {
+            iterator(x, function (result) {
+                if (result) {
+                    main_callback(x);
+                    main_callback = function () {};
+                }
+                else {
+                    callback();
+                }
+            });
+        }, function (err) {
+            main_callback();
+        });
+    };
+    async.detect = doParallel(_detect);
+    async.detectSeries = doSeries(_detect);
+
+    async.some = function (arr, iterator, main_callback) {
+        async.each(arr, function (x, callback) {
+            iterator(x, function (v) {
+                if (v) {
+                    main_callback(true);
+                    main_callback = function () {};
+                }
+                callback();
+            });
+        }, function (err) {
+            main_callback(false);
+        });
+    };
+    // any alias
+    async.any = async.some;
+
+    async.every = function (arr, iterator, main_callback) {
+        async.each(arr, function (x, callback) {
+            iterator(x, function (v) {
+                if (!v) {
+                    main_callback(false);
+                    main_callback = function () {};
+                }
+                callback();
+            });
+        }, function (err) {
+            main_callback(true);
+        });
+    };
+    // all alias
+    async.all = async.every;
+
+    async.sortBy = function (arr, iterator, callback) {
+        async.map(arr, function (x, callback) {
+            iterator(x, function (err, criteria) {
+                if (err) {
+                    callback(err);
+                }
+                else {
+                    callback(null, {value: x, criteria: criteria});
+                }
+            });
+        }, function (err, results) {
+            if (err) {
+                return callback(err);
+            }
+            else {
+                var fn = function (left, right) {
+                    var a = left.criteria, b = right.criteria;
+                    return a < b ? -1 : a > b ? 1 : 0;
+                };
+                callback(null, _map(results.sort(fn), function (x) {
+                    return x.value;
+                }));
+            }
+        });
+    };
+
+    async.auto = function (tasks, callback) {
+        callback = callback || function () {};
+        var keys = _keys(tasks);
+        if (!keys.length) {
+            return callback(null);
+        }
+
+        var results = {};
+
+        var listeners = [];
+        var addListener = function (fn) {
+            listeners.unshift(fn);
+        };
+        var removeListener = function (fn) {
+            for (var i = 0; i < listeners.length; i += 1) {
+                if (listeners[i] === fn) {
+                    listeners.splice(i, 1);
+                    return;
+                }
+            }
+        };
+        var taskComplete = function () {
+            _each(listeners.slice(0), function (fn) {
+                fn();
+            });
+        };
+
+        addListener(function () {
+            if (_keys(results).length === keys.length) {
+                callback(null, results);
+                callback = function () {};
+            }
+        });
+
+        _each(keys, function (k) {
+            var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
+            var taskCallback = function (err) {
+                var args = Array.prototype.slice.call(arguments, 1);
+                if (args.length <= 1) {
+                    args = args[0];
+                }
+                if (err) {
+                    var safeResults = {};
+                    _each(_keys(results), function(rkey) {
+                        safeResults[rkey] = results[rkey];
+                    });
+                    safeResults[k] = args;
+                    callback(err, safeResults);
+                    // stop subsequent errors hitting callback multiple times
+                    callback = function () {};
+                }
+                else {
+                    results[k] = args;
+                    async.setImmediate(taskComplete);
+                }
+            };
+            var requires = task.slice(0, Math.abs(task.length - 1)) || [];
+            var ready = function () {
+                return _reduce(requires, function (a, x) {
+                    return (a && results.hasOwnProperty(x));
+                }, true) && !results.hasOwnProperty(k);
+            };
+            if (ready()) {
+                task[task.length - 1](taskCallback, results);
+            }
+            else {
+                var listener = function () {
+                    if (ready()) {
+                        removeListener(listener);
+                        task[task.length - 1](taskCallback, results);
+                    }
+                };
+                addListener(listener);
+            }
+        });
+    };
+
+    async.waterfall = function (tasks, callback) {
+        callback = callback || function () {};
+        if (tasks.constructor !== Array) {
+          var err = new Error('First argument to waterfall must be an array of functions');
+          return callback(err);
+        }
+        if (!tasks.length) {
+            return callback();
+        }
+        var wrapIterator = function (iterator) {
+            return function (err) {
+                if (err) {
+                    callback.apply(null, arguments);
+                    callback = function () {};
+                }
+                else {
+                    var args = Array.prototype.slice.call(arguments, 1);
+                    var next = iterator.next();
+                    if (next) {
+                        args.push(wrapIterator(next));
+                    }
+                    else {
+                        args.push(callback);
+                    }
+                    async.setImmediate(function () {
+                        iterator.apply(null, args);
+                    });
+                }
+            };
+        };
+        wrapIterator(async.iterator(tasks))();
+    };
+
+    var _parallel = function(eachfn, tasks, callback) {
+        callback = callback || function () {};
+        if (tasks.constructor === Array) {
+            eachfn.map(tasks, function (fn, callback) {
+                if (fn) {
+                    fn(function (err) {
+                        var args = Array.prototype.slice.call(arguments, 1);
+                        if (args.length <= 1) {
+                            args = args[0];
+                        }
+                        callback.call(null, err, args);
+                    });
+                }
+            }, callback);
+        }
+        else {
+            var results = {};
+            eachfn.each(_keys(tasks), function (k, callback) {
+                tasks[k](function (err) {
+                    var args = Array.prototype.slice.call(arguments, 1);
+                    if (args.length <= 1) {
+                        args = args[0];
+                    }
+                    results[k] = args;
+                    callback(err);
+                });
+            }, function (err) {
+                callback(err, results);
+            });
+        }
+    };
+
+    async.parallel = function (tasks, callback) {
+        _parallel({ map: async.map, each: async.each }, tasks, callback);
+    };
+
+    async.parallelLimit = function(tasks, limit, callback) {
+        _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
+    };
+
+    async.series = function (tasks, callback) {
+        callback = callback || function () {};
+        if (tasks.constructor === Array) {
+            async.mapSeries(tasks, function (fn, callback) {
+                if (fn) {
+                    fn(function (err) {
+                        var args = Array.prototype.slice.call(arguments, 1);
+                        if (args.length <= 1) {
+                            args = args[0];
+                        }
+                        callback.call(null, err, args);
+                    });
+                }
+            }, callback);
+        }
+        else {
+            var results = {};
+            async.eachSeries(_keys(tasks), function (k, callback) {
+                tasks[k](function (err) {
+                    var args = Array.prototype.slice.call(arguments, 1);
+                    if (args.length <= 1) {
+                        args = args[0];
+                    }
+                    results[k] = args;
+                    callback(err);
+                });
+            }, function (err) {
+                callback(err, results);
+            });
+        }
+    };
+
+    async.iterator = function (tasks) {
+        var makeCallback = function (index) {
+            var fn = function () {
+                if (tasks.length) {
+                    tasks[index].apply(null, arguments);
+                }
+                return fn.next();
+            };
+            fn.next = function () {
+                return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+            };
+            return fn;
+        };
+        return makeCallback(0);
+    };
+
+    async.apply = function (fn) {
+        var args = Array.prototype.slice.call(arguments, 1);
+        return function () {
+            return fn.apply(
+                null, args.concat(Array.prototype.slice.call(arguments))
+            );
+        };
+    };
+
+    var _concat = function (eachfn, arr, fn, callback) {
+        var r = [];
+        eachfn(arr, function (x, cb) {
+            fn(x, function (err, y) {
+                r = r.concat(y || []);
+                cb(err);
+            });
+        }, function (err) {
+            callback(err, r);
+        });
+    };
+    async.concat = doParallel(_concat);
+    async.concatSeries = doSeries(_concat);
+
+    async.whilst = function (test, iterator, callback) {
+        if (test()) {
+            iterator(function (err) {
+                if (err) {
+                    return callback(err);
+                }
+                async.whilst(test, iterator, callback);
+            });
+        }
+        else {
+            callback();
+        }
+    };
+
+    async.doWhilst = function (iterator, test, callback) {
+        iterator(function (err) {
+            if (err) {
+                return callback(err);
+            }
+            if (test()) {
+                async.doWhilst(iterator, test, callback);
+            }
+            else {
+                callback();
+            }
+        });
+    };
+
+    async.until = function (test, iterator, callback) {
+        if (!test()) {
+            iterator(function (err) {
+                if (err) {
+                    return callback(err);
+                }
+                async.until(test, iterator, callback);
+            });
+        }
+        else {
+            callback();
+        }
+    };
+
+    async.doUntil = function (iterator, test, callback) {
+        iterator(function (err) {
+            if (err) {
+                return callback(err);
+            }
+            if (!test()) {
+                async.doUntil(iterator, test, callback);
+            }
+            else {
+                callback();
+            }
+        });
+    };
+
+    async.queue = function (worker, concurrency) {
+        if (concurrency === undefined) {
+            concurrency = 1;
+        }
+        function _insert(q, data, pos, callback) {
+          if(data.constructor !== Array) {
+              data = [data];
+          }
+          _each(data, function(task) {
+              var item = {
+                  data: task,
+                  callback: typeof callback === 'function' ? callback : null
+              };
+
+              if (pos) {
+                q.tasks.unshift(item);
+              } else {
+                q.tasks.push(item);
+              }
+
+              if (q.saturated && q.tasks.length === concurrency) {
+                  q.saturated();
+              }
+              async.setImmediate(q.process);
+          });
+        }
+
+        var workers = 0;
+        var q = {
+            tasks: [],
+            concurrency: concurrency,
+            saturated: null,
+            empty: null,
+            drain: null,
+            push: function (data, callback) {
+              _insert(q, data, false, callback);
+            },
+            unshift: function (data, callback) {
+              _insert(q, data, true, callback);
+            },
+            process: function () {
+                if (workers < q.concurrency && q.tasks.length) {
+                    var task = q.tasks.shift();
+                    if (q.empty && q.tasks.length === 0) {
+                        q.empty();
+                    }
+                    workers += 1;
+                    var next = function () {
+                        workers -= 1;
+                        if (task.callback) {
+                            task.callback.apply(task, arguments);
+                        }
+                        if (q.drain && q.tasks.length + workers === 0) {
+                            q.drain();
+                        }
+                        q.process();
+                    };
+                    var cb = only_once(next);
+                    worker(task.data, cb);
+                }
+            },
+            length: function () {
+                return q.tasks.length;
+            },
+            running: function () {
+                return workers;
+            }
+        };
+        return q;
+    };
+
+    async.cargo = function (worker, payload) {
+        var working     = false,
+            tasks       = [];
+
+        var cargo = {
+            tasks: tasks,
+            payload: payload,
+            saturated: null,
+            empty: null,
+            drain: null,
+            push: function (data, callback) {
+                if(data.constructor !== Array) {
+                    data = [data];
+                }
+                _each(data, function(task) {
+                    tasks.push({
+                        data: task,
+                        callback: typeof callback === 'function' ? callback : null
+                    });
+                    if (cargo.saturated && tasks.length === payload) {
+                        cargo.saturated();
+                    }
+                });
+                async.setImmediate(cargo.process);
+            },
+            process: function process() {
+                if (working) return;
+                if (tasks.length === 0) {
+                    if(cargo.drain) cargo.drain();
+                    return;
+                }
+
+                var ts = typeof payload === 'number'
+                            ? tasks.splice(0, payload)
+                            : tasks.splice(0);
+
+                var ds = _map(ts, function (task) {
+                    return task.data;
+                });
+
+                if(cargo.empty) cargo.empty();
+                working = true;
+                worker(ds, function () {
+                    working = false;
+
+                    var args = arguments;
+                    _each(ts, function (data) {
+                        if (data.callback) {
+                            data.callback.apply(null, args);
+                        }
+                    });
+
+                    process();
+                });
+            },
+            length: function () {
+                return tasks.length;
+            },
+            running: function () {
+                return working;
+            }
+        };
+        return cargo;
+    };
+
+    var _console_fn = function (name) {
+        return function (fn) {
+            var args = Array.prototype.slice.call(arguments, 1);
+            fn.apply(null, args.concat([function (err) {
+                var args = Array.prototype.slice.call(arguments, 1);
+                if (typeof console !== 'undefined') {
+                    if (err) {
+                        if (console.error) {
+                            console.error(err);
+                        }
+                    }
+                    else if (console[name]) {
+                        _each(args, function (x) {
+                            console[name](x);
+                        });
+                    }
+                }
+            }]));
+        };
+    };
+    async.log = _console_fn('log');
+    async.dir = _console_fn('dir');
+    /*async.info = _console_fn('info');
+    async.warn = _console_fn('warn');
+    async.error = _console_fn('error');*/
+
+    async.memoize = function (fn, hasher) {
+        var memo = {};
+        var queues = {};
+        hasher = hasher || function (x) {
+            return x;
+        };
+        var memoized = function () {
+            var args = Array.prototype.slice.call(arguments);
+            var callback = args.pop();
+            var key = hasher.apply(null, args);
+            if (key in memo) {
+                callback.apply(null, memo[key]);
+            }
+            else if (key in queues) {
+                queues[key].push(callback);
+            }
+            else {
+                queues[key] = [callback];
+                fn.apply(null, args.concat([function () {
+                    memo[key] = arguments;
+                    var q = queues[key];
+                    delete queues[key];
+                    for (var i = 0, l = q.length; i < l; i++) {
+                      q[i].apply(null, arguments);
+                    }
+                }]));
+            }
+        };
+        memoized.memo = memo;
+        memoized.unmemoized = fn;
+        return memoized;
+    };
+
+    async.unmemoize = function (fn) {
+      return function () {
+        return (fn.unmemoized || fn).apply(null, arguments);
+      };
+    };
+
+    async.times = function (count, iterator, callback) {
+        var counter = [];
+        for (var i = 0; i < count; i++) {
+            counter.push(i);
+        }
+        return async.map(counter, iterator, callback);
+    };
+
+    async.timesSeries = function (count, iterator, callback) {
+        var counter = [];
+        for (var i = 0; i < count; i++) {
+            counter.push(i);
+        }
+        return async.mapSeries(counter, iterator, callback);
+    };
+
+    async.compose = function (/* functions... */) {
+        var fns = Array.prototype.reverse.call(arguments);
+        return function () {
+            var that = this;
+            var args = Array.prototype.slice.call(arguments);
+            var callback = args.pop();
+            async.reduce(fns, args, function (newargs, fn, cb) {
+                fn.apply(that, newargs.concat([function () {
+                    var err = arguments[0];
+                    var nextargs = Array.prototype.slice.call(arguments, 1);
+                    cb(err, nextargs);
+                }]))
+            },
+            function (err, results) {
+                callback.apply(that, [err].concat(results));
+            });
+        };
+    };
+
+    var _applyEach = function (eachfn, fns /*args...*/) {
+        var go = function () {
+            var that = this;
+            var args = Array.prototype.slice.call(arguments);
+            var callback = args.pop();
+            return eachfn(fns, function (fn, cb) {
+                fn.apply(that, args.concat([cb]));
+            },
+            callback);
+        };
+        if (arguments.length > 2) {
+            var args = Array.prototype.slice.call(arguments, 2);
+            return go.apply(this, args);
+        }
+        else {
+            return go;
+        }
+    };
+    async.applyEach = doParallel(_applyEach);
+    async.applyEachSeries = doSeries(_applyEach);
+
+    async.forever = function (fn, callback) {
+        function next(err) {
+            if (err) {
+                if (callback) {
+                    return callback(err);
+                }
+                throw err;
+            }
+            fn(next);
+        }
+        next();
+    };
+
+    // AMD / RequireJS
+    if (typeof define !== 'undefined' && define.amd) {
+        define([], function () {
+            return async;
+        });
+    }
+    // Node.js
+    else if (typeof module !== 'undefined' && module.exports) {
+        module.exports = async;
+    }
+    // included directly via <script> tag
+    else {
+        root.async = async;
+    }
+
+}());
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/async/package.json	(revision 487)
@@ -0,0 +1,47 @@
+{
+  "name": "async",
+  "description": "Higher-order functions and common patterns for asynchronous code",
+  "main": "./lib/async",
+  "author": {
+    "name": "Caolan McMahon"
+  },
+  "version": "0.2.10",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/caolan/async.git"
+  },
+  "bugs": {
+    "url": "https://github.com/caolan/async/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/caolan/async/raw/master/LICENSE"
+    }
+  ],
+  "devDependencies": {
+    "nodeunit": ">0.0.0",
+    "uglify-js": "1.2.x",
+    "nodelint": ">0.0.0"
+  },
+  "jam": {
+    "main": "lib/async.js",
+    "include": [
+      "lib/async.js",
+      "README.md",
+      "LICENSE"
+    ]
+  },
+  "scripts": {
+    "test": "nodeunit test/test-async.js"
+  },
+  "readme": "# Async.js\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [node.js](http://nodejs.org), it can also be used directly in the\nbrowser. Also supports [component](https://github.com/component/component).\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (map, reduce, filter, eachâŠ) as well as some common patterns\nfor asynchronous control flow (parallel, series, waterfallâŠ). All these\nfunctions assume you follow the node.js convention of providing a single\ncallback as the last argument of your async function.\n\n\n## Quick Examples\n\n```javascript\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n    // results is now an array of stats for each file\n});\n\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n    // results now equals an array of the existing files\n});\n\nasync.parallel([\n    function(){ ... },\n    function(){ ... }\n], callback);\n\nasync.series([\n    function(){ ... },\n    function(){ ... }\n]);\n```\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n## Common Pitfalls\n\n### Binding a context to an iterator\n\nThis section is really about bind, not about async. If you are wondering how to\nmake async execute your iterators in a given context, or are confused as to why\na method of another library isn't working as an iterator, study this example:\n\n```js\n// Here is a simple object with an (unnecessarily roundabout) squaring method\nvar AsyncSquaringLibrary = {\n  squareExponent: 2,\n  square: function(number, callback){ \n    var result = Math.pow(number, this.squareExponent);\n    setTimeout(function(){\n      callback(null, result);\n    }, 200);\n  }\n};\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\n  // result is [NaN, NaN, NaN]\n  // This fails because the `this.squareExponent` expression in the square\n  // function is not evaluated in the context of AsyncSquaringLibrary, and is\n  // therefore undefined.\n});\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\n  // result is [1, 4, 9]\n  // With the help of bind we can attach a context to the iterator before\n  // passing it to async. Now the square function will be executed in its \n  // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\n  // will be as expected.\n});\n```\n\n## Download\n\nThe source is available for download from\n[GitHub](http://github.com/caolan/async).\nAlternatively, you can install using Node Package Manager (npm):\n\n    npm install async\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\n\n## In the Browser\n\nSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:\n\n```html\n<script type=\"text/javascript\" src=\"async.js\"></script>\n<script type=\"text/javascript\">\n\n    async.map(data, asyncProcess, function(err, results){\n        alert(results);\n    });\n\n</script>\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [eachSeries](#eachSeries)\n* [eachLimit](#eachLimit)\n* [map](#map)\n* [mapSeries](#mapSeries)\n* [mapLimit](#mapLimit)\n* [filter](#filter)\n* [filterSeries](#filterSeries)\n* [reject](#reject)\n* [rejectSeries](#rejectSeries)\n* [reduce](#reduce)\n* [reduceRight](#reduceRight)\n* [detect](#detect)\n* [detectSeries](#detectSeries)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n* [concatSeries](#concatSeries)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [parallelLimit](#parallellimittasks-limit-callback)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [applyEachSeries](#applyEachSeries)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n<a name=\"forEach\" />\n<a name=\"each\" />\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n  The iterator is passed a callback(err) which must be called once it has \n  completed. If no error has occured, the callback should be run without \n  arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n  have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n    // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n<a name=\"forEachSeries\" />\n<a name=\"eachSeries\" />\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n<a name=\"forEachLimit\" />\n<a name=\"eachLimit\" />\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n  The iterator is passed a callback(err) which must be called once it has \n  completed. If no error has occured, the callback should be run without \n  arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n  have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n    // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n<a name=\"map\" />\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n  The iterator is passed a callback(err, transformed) which must be called once \n  it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n  functions have finished, or an error has occurred. Results is an array of the\n  transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n    // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n<a name=\"mapSeries\" />\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n<a name=\"mapLimit\" />\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n  The iterator is passed a callback(err, transformed) which must be called once \n  it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n  functions have finished, or an error has occurred. Results is an array of the\n  transformed items from the original array.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n    // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n<a name=\"filter\" />\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n  The iterator is passed a callback(truthValue) which must be called with a \n  boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n  functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n    // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n<a name=\"filterSeries\" />\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n<a name=\"reject\" />\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n<a name=\"rejectSeries\" />\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n<a name=\"reduce\" />\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n  array to produce the next step in the reduction. The iterator is passed a\n  callback(err, reduction) which accepts an optional error as its first \n  argument, and the state of the reduction as the second. If an error is \n  passed to the callback, the reduction is stopped and the main callback is \n  immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n  functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n    // pointless async:\n    process.nextTick(function(){\n        callback(null, memo + item)\n    });\n}, function(err, result){\n    // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n<a name=\"reduceRight\" />\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n<a name=\"detect\" />\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n  The iterator is passed a callback(truthValue) which must be called with a \n  boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n  true, or after all the iterator functions have finished. Result will be\n  the first item in the array that passes the truth test (iterator) or the\n  value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n    // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n<a name=\"detectSeries\" />\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n<a name=\"sortBy\" />\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n  The iterator is passed a callback(err, sortValue) which must be called once it\n  has completed with an error (which can be null) and a value to use as the sort\n  criteria.\n* callback(err, results) - A callback which is called after all the iterator\n  functions have finished, or an error has occurred. Results is the items from\n  the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n    fs.stat(file, function(err, stats){\n        callback(err, stats.mtime);\n    });\n}, function(err, results){\n    // results is now the original array of files sorted by\n    // modified date\n});\n```\n\n---------------------------------------\n\n<a name=\"some\" />\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n  The iterator is passed a callback(truthValue) which must be called with a \n  boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n  true, or after all the iterator functions have finished. Result will be\n  either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n    // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n<a name=\"every\" />\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n  The iterator is passed a callback(truthValue) which must be called with a \n  boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n  functions have finished. Result will be either true or false depending on\n  the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n    // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n<a name=\"concat\" />\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n  The iterator is passed a callback(err, results) which must be called once it \n  has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n  functions have finished, or an error has occurred. Results is an array containing\n  the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n    // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n<a name=\"concatSeries\" />\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n<a name=\"series\" />\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n  a callback(err, result) it must call on completion with an error (which can\n  be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n  have completed. This function gets a results array (or object) containing all \n  the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n    function(callback){\n        // do some stuff ...\n        callback(null, 'one');\n    },\n    function(callback){\n        // do some more stuff ...\n        callback(null, 'two');\n    }\n],\n// optional callback\nfunction(err, results){\n    // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n    one: function(callback){\n        setTimeout(function(){\n            callback(null, 1);\n        }, 200);\n    },\n    two: function(callback){\n        setTimeout(function(){\n            callback(null, 2);\n        }, 100);\n    }\n},\nfunction(err, results) {\n    // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n  a callback(err, result) it must call on completion with an error (which can\n  be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n  have completed. This function gets a results array (or object) containing all \n  the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n    function(callback){\n        setTimeout(function(){\n            callback(null, 'one');\n        }, 200);\n    },\n    function(callback){\n        setTimeout(function(){\n            callback(null, 'two');\n        }, 100);\n    }\n],\n// optional callback\nfunction(err, results){\n    // the results array will equal ['one','two'] even though\n    // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n    one: function(callback){\n        setTimeout(function(){\n            callback(null, 1);\n        }, 200);\n    },\n    two: function(callback){\n        setTimeout(function(){\n            callback(null, 2);\n        }, 100);\n    }\n},\nfunction(err, results) {\n    // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n  a callback(err, result) it must call on completion with an error (which can\n  be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n  have completed. This function gets a results array (or object) containing all \n  the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n<a name=\"whilst\" />\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n  passed a callback(err) which must be called once it has completed with an \n  optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n  execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n    function () { return count < 5; },\n    function (callback) {\n        count++;\n        setTimeout(callback, 1000);\n    },\n    function (err) {\n        // 5 seconds have passed\n    }\n);\n```\n\n---------------------------------------\n\n<a name=\"doWhilst\" />\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n<a name=\"until\" />\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n<a name=\"doUntil\" />\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n<a name=\"forever\" />\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n<a name=\"waterfall\" />\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n  callback(err, result1, result2, ...) it must call on completion. The first\n  argument is an error (which can be null) and any further arguments will be \n  passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n  have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n    function(callback){\n        callback(null, 'one', 'two');\n    },\n    function(arg1, arg2, callback){\n        callback(null, 'three');\n    },\n    function(arg1, callback){\n        // arg1 now equals 'three'\n        callback(null, 'done');\n    }\n], function (err, result) {\n   // result now equals 'done'    \n});\n```\n\n---------------------------------------\n<a name=\"compose\" />\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n    setTimeout(function () {\n        callback(null, n + 1);\n    }, 10);\n}\n\nfunction mul3(n, callback) {\n    setTimeout(function () {\n        callback(null, n * 3);\n    }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n   // result now equals 15\n});\n```\n\n---------------------------------------\n<a name=\"applyEach\" />\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n  functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n    buckets,\n    async.applyEach([enableSearch, updateSchema]),\n    callback\n);\n```\n\n---------------------------------------\n\n<a name=\"applyEachSeries\" />\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n<a name=\"queue\" />\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n  task, which must call its callback(err) argument when finished, with an \n  optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n  run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n  run in parallel. This property can be changed after a queue is created to\n  alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n  once the worker has finished processing the task.\n  instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n    console.log('hello ' + task.name);\n    callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n    console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n    console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n    console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n    console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n    console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n<a name=\"cargo\" />\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n  queued tasks, which must call its callback(err) argument when finished, with \n  an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n  processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n  process per round. This property can be changed after a cargo is created to\n  alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n  once the worker has finished processing the task.\n  instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n    for(var i=0; i<tasks.length; i++){\n      console.log('hello ' + tasks[i].name);\n    }\n    callback();\n}, 2);\n\n\n// add some items\n\ncargo.push({name: 'foo'}, function (err) {\n    console.log('finished processing foo');\n});\ncargo.push({name: 'bar'}, function (err) {\n    console.log('finished processing bar');\n});\ncargo.push({name: 'baz'}, function (err) {\n    console.log('finished processing baz');\n});\n```\n\n---------------------------------------\n\n<a name=\"auto\" />\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n  readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n  readData: function(cb, results){\n    fs.readFile('data.txt', 'utf-8', cb);\n  }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n  requirements, with the function itself the last item in the array. The key\n  used for each function or array is used when specifying requirements. The \n  function receives two arguments: (1) a callback(err, result) which must be \n  called when finished, passing an error (which can be null) and the result of \n  the function's execution, and (2) a results object, containing the results of\n  the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n  tasks have been completed. The callback will receive an error as an argument\n  if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n  \n\n__Example__\n\n```js\nasync.auto({\n    get_data: function(callback){\n        // async code to get some data\n    },\n    make_folder: function(callback){\n        // async code to create a directory to store a file in\n        // this is run at the same time as getting the data\n    },\n    write_file: ['get_data', 'make_folder', function(callback){\n        // once there is some data and the directory exists,\n        // write the data to a file in the directory\n        callback(null, filename);\n    }],\n    email_link: ['write_file', function(callback, results){\n        // once the file is written let's email a link to it...\n        // results.write_file contains the filename returned by write_file.\n    }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n    function(callback){\n        // async code to get some data\n    },\n    function(callback){\n        // async code to create a directory to store a file in\n        // this is run at the same time as getting the data\n    }\n],\nfunction(err, results){\n    async.series([\n        function(callback){\n            // once there is some data and the directory exists,\n            // write the data to a file in the directory\n        },\n        function(callback){\n            // once the file is written let's email a link to it...\n        }\n    ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n<a name=\"iterator\" />\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n    function(){ sys.p('one'); },\n    function(){ sys.p('two'); },\n    function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n<a name=\"apply\" />\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n  continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n    async.apply(fs.writeFile, 'testfile1', 'test1'),\n    async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n    function(callback){\n        fs.writeFile('testfile1', 'test1', callback);\n    },\n    function(callback){\n        fs.writeFile('testfile2', 'test2', callback);\n    }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n<a name=\"nextTick\" />\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n    call_order.push('two');\n    // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n<a name=\"times\" />\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n  callback(null, {\n    id: 'user' + id\n  })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n    createUser(n, function(err, user) {\n      next(err, user)\n    })\n}, function(err, users) {\n  // we should now have 5 users\n});\n```\n\n<a name=\"timesSeries\" />\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n<a name=\"memoize\" />\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n  results, it has all the arguments applied to it apart from the callback, and\n  must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n    // do something\n    callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n    // callback\n});\n```\n\n<a name=\"unmemoize\" />\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n<a name=\"log\" />\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n    setTimeout(function(){\n        callback(null, 'hello ' + name);\n    }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n<a name=\"dir\" />\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n    setTimeout(function(){\n        callback(null, {hello: name});\n    }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n<a name=\"noConflict\" />\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n",
+  "readmeFilename": "README.md",
+  "homepage": "https://github.com/caolan/async",
+  "_id": "async@0.2.10",
+  "dist": {
+    "shasum": "7c691f5d6d8c59427796e198d4a5f5acf0e76417"
+  },
+  "_from": "async@~0.2.9",
+  "_resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/.npmignore	(revision 487)
@@ -0,0 +1,3 @@
+*.un~
+/node_modules
+/test/tmp
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/License
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/License	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/License	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/Makefile	(revision 487)
@@ -0,0 +1,7 @@
+SHELL := /bin/bash
+
+test:
+	@./test/run.js
+
+.PHONY: test
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/Readme.md	(revision 487)
@@ -0,0 +1,132 @@
+# combined-stream
+
+A stream that emits multiple other streams one after another.
+
+## Installation
+
+``` bash
+npm install combined-stream
+```
+
+## Usage
+
+Here is a simple example that shows how you can use combined-stream to combine
+two files into one:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+While the example above works great, it will pause all source streams until
+they are needed. If you don't want that to happen, you can set `pauseStreams`
+to `false`:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create({pauseStreams: false});
+combinedStream.append(fs.createReadStream('file1.txt'));
+combinedStream.append(fs.createReadStream('file2.txt'));
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+However, what if you don't have all the source streams yet, or you don't want
+to allocate the resources (file descriptors, memory, etc.) for them right away?
+Well, in that case you can simply provide a callback that supplies the stream
+by calling a `next()` function:
+
+``` javascript
+var CombinedStream = require('combined-stream');
+var fs = require('fs');
+
+var combinedStream = CombinedStream.create();
+combinedStream.append(function(next) {
+  next(fs.createReadStream('file1.txt'));
+});
+combinedStream.append(function(next) {
+  next(fs.createReadStream('file2.txt'));
+});
+
+combinedStream.pipe(fs.createWriteStream('combined.txt'));
+```
+
+## API
+
+### CombinedStream.create([options])
+
+Returns a new combined stream object. Available options are:
+
+* `maxDataSize`
+* `pauseStreams`
+
+The effect of those options is described below.
+
+### combinedStream.pauseStreams = true
+
+Whether to apply back pressure to the underlaying streams. If set to `false`,
+the underlaying streams will never be paused. If set to `true`, the
+underlaying streams will be paused right after being appended, as well as when
+`delayedStream.pipe()` wants to throttle.
+
+### combinedStream.maxDataSize = 2 * 1024 * 1024
+
+The maximum amount of bytes (or characters) to buffer for all source streams.
+If this value is exceeded, `combinedStream` emits an `'error'` event.
+
+### combinedStream.dataSize = 0
+
+The amount of bytes (or characters) currently buffered by `combinedStream`.
+
+### combinedStream.append(stream)
+
+Appends the given `stream` to the combinedStream object. If `pauseStreams` is
+set to `true, this stream will also be paused right away.
+
+`streams` can also be a function that takes one parameter called `next`. `next`
+is a function that must be invoked in order to provide the `next` stream, see
+example above.
+
+Regardless of how the `stream` is appended, combined-stream always attaches an
+`'error'` listener to it, so you don't have to do that manually.
+
+Special case: `stream` can also be a String or Buffer.
+
+### combinedStream.write(data)
+
+You should not call this, `combinedStream` takes care of piping the appended
+streams into itself for you.
+
+### combinedStream.resume()
+
+Causes `combinedStream` to start drain the streams it manages. The function is
+idempotent, and also emits a `'resume'` event each time which usually goes to
+the stream that is currently being drained.
+
+### combinedStream.pause();
+
+If `combinedStream.pauseStreams` is set to `false`, this does nothing.
+Otherwise a `'pause'` event is emitted, this goes to the stream that is
+currently being drained, so you can use it to apply back pressure.
+
+### combinedStream.end();
+
+Sets `combinedStream.writable` to false, emits an `'end'` event, and removes
+all streams from the queue.
+
+### combinedStream.destroy();
+
+Same as `combinedStream.end()`, except it emits a `'close'` event instead of
+`'end'`.
+
+## License
+
+combined-stream is licensed under the MIT license.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/lib/combined_stream.js	(revision 487)
@@ -0,0 +1,185 @@
+var util = require('util');
+var Stream = require('stream').Stream;
+var DelayedStream = require('delayed-stream');
+
+module.exports = CombinedStream;
+function CombinedStream() {
+  this.writable = false;
+  this.readable = true;
+  this.dataSize = 0;
+  this.maxDataSize = 2 * 1024 * 1024;
+  this.pauseStreams = true;
+
+  this._released = false;
+  this._streams = [];
+  this._currentStream = null;
+}
+util.inherits(CombinedStream, Stream);
+
+CombinedStream.create = function(options) {
+  var combinedStream = new this();
+
+  options = options || {};
+  for (var option in options) {
+    combinedStream[option] = options[option];
+  }
+
+  return combinedStream;
+};
+
+CombinedStream.isStreamLike = function(stream) {
+  return (typeof stream !== 'function')
+    && (typeof stream !== 'string')
+    && (typeof stream !== 'boolean')    
+    && (typeof stream !== 'number')
+    && (!Buffer.isBuffer(stream));
+};
+
+CombinedStream.prototype.append = function(stream) {
+  var isStreamLike = CombinedStream.isStreamLike(stream);
+
+  if (isStreamLike) {
+    if (!(stream instanceof DelayedStream)) {
+      stream.on('data', this._checkDataSize.bind(this));
+
+      stream = DelayedStream.create(stream, {
+        maxDataSize: Infinity,
+        pauseStream: this.pauseStreams,
+      });
+    }
+
+    this._handleErrors(stream);
+
+    if (this.pauseStreams) {
+      stream.pause();
+    }
+  }
+
+  this._streams.push(stream);
+  return this;
+};
+
+CombinedStream.prototype.pipe = function(dest, options) {
+  Stream.prototype.pipe.call(this, dest, options);
+  this.resume();
+};
+
+CombinedStream.prototype._getNext = function() {
+  this._currentStream = null;
+  var stream = this._streams.shift();
+
+
+  if (typeof stream == 'undefined') {
+    this.end();
+    return;
+  }
+
+  if (typeof stream !== 'function') {
+    this._pipeNext(stream);
+    return;
+  }
+
+  var getStream = stream;
+  getStream(function(stream) {
+    var isStreamLike = CombinedStream.isStreamLike(stream);
+    if (isStreamLike) {
+      stream.on('data', this._checkDataSize.bind(this));
+      this._handleErrors(stream);
+    }
+
+    this._pipeNext(stream);
+  }.bind(this));
+};
+
+CombinedStream.prototype._pipeNext = function(stream) {
+  this._currentStream = stream;
+
+  var isStreamLike = CombinedStream.isStreamLike(stream);
+  if (isStreamLike) {
+    stream.on('end', this._getNext.bind(this))
+    stream.pipe(this, {end: false});
+    return;
+  }
+
+  var value = stream;
+  this.write(value);
+  this._getNext();
+};
+
+CombinedStream.prototype._handleErrors = function(stream) {
+  var self = this;
+  stream.on('error', function(err) {
+    self._emitError(err);
+  });
+};
+
+CombinedStream.prototype.write = function(data) {
+  this.emit('data', data);
+};
+
+CombinedStream.prototype.pause = function() {
+  if (!this.pauseStreams) {
+    return;
+  }
+
+  this.emit('pause');
+};
+
+CombinedStream.prototype.resume = function() {
+  if (!this._released) {
+    this._released = true;
+    this.writable = true;
+    this._getNext();
+  }
+
+  this.emit('resume');
+};
+
+CombinedStream.prototype.end = function() {
+  this._reset();
+  this.emit('end');
+};
+
+CombinedStream.prototype.destroy = function() {
+  this._reset();
+  this.emit('close');
+};
+
+CombinedStream.prototype._reset = function() {
+  this.writable = false;
+  this._streams = [];
+  this._currentStream = null;
+};
+
+CombinedStream.prototype._checkDataSize = function() {
+  this._updateDataSize();
+  if (this.dataSize <= this.maxDataSize) {
+    return;
+  }
+
+  var message =
+    'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+  this._emitError(new Error(message));
+};
+
+CombinedStream.prototype._updateDataSize = function() {
+  this.dataSize = 0;
+
+  var self = this;
+  this._streams.forEach(function(stream) {
+    if (!stream.dataSize) {
+      return;
+    }
+
+    self.dataSize += stream.dataSize;
+  });
+
+  if (this._currentStream && this._currentStream.dataSize) {
+    this.dataSize += this._currentStream.dataSize;
+  }
+};
+
+CombinedStream.prototype._emitError = function(err) {
+  this._reset();
+  this.emit('error', err);
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/.npmignore	(revision 487)
@@ -0,0 +1,2 @@
+*.un~
+/node_modules/*
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/License	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Debuggable Limited <felix@debuggable.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Makefile	(revision 487)
@@ -0,0 +1,7 @@
+SHELL := /bin/bash
+
+test:
+	@./test/run.js
+
+.PHONY: test
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/Readme.md	(revision 487)
@@ -0,0 +1,154 @@
+# delayed-stream
+
+Buffers events from a stream until you are ready to handle them.
+
+## Installation
+
+``` bash
+npm install delayed-stream
+```
+
+## Usage
+
+The following example shows how to write a http echo server that delays its
+response by 1000 ms.
+
+``` javascript
+var DelayedStream = require('delayed-stream');
+var http = require('http');
+
+http.createServer(function(req, res) {
+  var delayed = DelayedStream.create(req);
+
+  setTimeout(function() {
+    res.writeHead(200);
+    delayed.pipe(res);
+  }, 1000);
+});
+```
+
+If you are not using `Stream#pipe`, you can also manually release the buffered
+events by calling `delayedStream.resume()`:
+
+``` javascript
+var delayed = DelayedStream.create(req);
+
+setTimeout(function() {
+  // Emit all buffered events and resume underlaying source
+  delayed.resume();
+}, 1000);
+```
+
+## Implementation
+
+In order to use this meta stream properly, here are a few things you should
+know about the implementation.
+
+### Event Buffering / Proxying
+
+All events of the `source` stream are hijacked by overwriting the `source.emit`
+method. Until node implements a catch-all event listener, this is the only way.
+
+However, delayed-stream still continues to emit all events it captures on the
+`source`, regardless of whether you have released the delayed stream yet or
+not.
+
+Upon creation, delayed-stream captures all `source` events and stores them in
+an internal event buffer. Once `delayedStream.release()` is called, all
+buffered events are emitted on the `delayedStream`, and the event buffer is
+cleared. After that, delayed-stream merely acts as a proxy for the underlaying
+source.
+
+### Error handling
+
+Error events on `source` are buffered / proxied just like any other events.
+However, `delayedStream.create` attaches a no-op `'error'` listener to the
+`source`. This way you only have to handle errors on the `delayedStream`
+object, rather than in two places.
+
+### Buffer limits
+
+delayed-stream provides a `maxDataSize` property that can be used to limit
+the amount of data being buffered. In order to protect you from bad `source`
+streams that don't react to `source.pause()`, this feature is enabled by
+default.
+
+## API
+
+### DelayedStream.create(source, [options])
+
+Returns a new `delayedStream`. Available options are:
+
+* `pauseStream`
+* `maxDataSize`
+
+The description for those properties can be found below.
+
+### delayedStream.source
+
+The `source` stream managed by this object. This is useful if you are
+passing your `delayedStream` around, and you still want to access properties
+on the `source` object.
+
+### delayedStream.pauseStream = true
+
+Whether to pause the underlaying `source` when calling
+`DelayedStream.create()`. Modifying this property afterwards has no effect.
+
+### delayedStream.maxDataSize = 1024 * 1024
+
+The amount of data to buffer before emitting an `error`.
+
+If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
+refers to bytes.
+
+If the underlaying source is emitting JavaScript strings, the size refers to
+characters.
+
+If you know what you are doing, you can set this property to `Infinity` to
+disable this feature. You can also modify this property during runtime.
+
+### delayedStream.maxDataSize = 1024 * 1024
+
+The amount of data to buffer before emitting an `error`.
+
+If the underlaying source is emitting `Buffer` objects, the `maxDataSize`
+refers to bytes.
+
+If the underlaying source is emitting JavaScript strings, the size refers to
+characters.
+
+If you know what you are doing, you can set this property to `Infinity` to
+disable this feature.
+
+### delayedStream.dataSize = 0
+
+The amount of data buffered so far.
+
+### delayedStream.readable
+
+An ECMA5 getter that returns the value of `source.readable`.
+
+### delayedStream.resume()
+
+If the `delayedStream` has not been released so far, `delayedStream.release()`
+is called.
+
+In either case, `source.resume()` is called.
+
+### delayedStream.pause()
+
+Calls `source.pause()`.
+
+### delayedStream.pipe(dest)
+
+Calls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.
+
+### delayedStream.release()
+
+Emits and clears all events that have been buffered up so far. This does not
+resume the underlaying source, use `delayedStream.resume()` instead.
+
+## License
+
+delayed-stream is licensed under the MIT license.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/lib/delayed_stream.js	(revision 487)
@@ -0,0 +1,99 @@
+var Stream = require('stream').Stream;
+var util = require('util');
+
+module.exports = DelayedStream;
+function DelayedStream() {
+  this.source = null;
+  this.dataSize = 0;
+  this.maxDataSize = 1024 * 1024;
+  this.pauseStream = true;
+
+  this._maxDataSizeExceeded = false;
+  this._released = false;
+  this._bufferedEvents = [];
+}
+util.inherits(DelayedStream, Stream);
+
+DelayedStream.create = function(source, options) {
+  var delayedStream = new this();
+
+  options = options || {};
+  for (var option in options) {
+    delayedStream[option] = options[option];
+  }
+
+  delayedStream.source = source;
+
+  var realEmit = source.emit;
+  source.emit = function() {
+    delayedStream._handleEmit(arguments);
+    return realEmit.apply(source, arguments);
+  };
+
+  source.on('error', function() {});
+  if (delayedStream.pauseStream) {
+    source.pause();
+  }
+
+  return delayedStream;
+};
+
+DelayedStream.prototype.__defineGetter__('readable', function() {
+  return this.source.readable;
+});
+
+DelayedStream.prototype.resume = function() {
+  if (!this._released) {
+    this.release();
+  }
+
+  this.source.resume();
+};
+
+DelayedStream.prototype.pause = function() {
+  this.source.pause();
+};
+
+DelayedStream.prototype.release = function() {
+  this._released = true;
+
+  this._bufferedEvents.forEach(function(args) {
+    this.emit.apply(this, args);
+  }.bind(this));
+  this._bufferedEvents = [];
+};
+
+DelayedStream.prototype.pipe = function() {
+  var r = Stream.prototype.pipe.apply(this, arguments);
+  this.resume();
+  return r;
+};
+
+DelayedStream.prototype._handleEmit = function(args) {
+  if (this._released) {
+    this.emit.apply(this, args);
+    return;
+  }
+
+  if (args[0] === 'data') {
+    this.dataSize += args[1].length;
+    this._checkIfMaxDataSizeExceeded();
+  }
+
+  this._bufferedEvents.push(args);
+};
+
+DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
+  if (this._maxDataSizeExceeded) {
+    return;
+  }
+
+  if (this.dataSize <= this.maxDataSize) {
+    return;
+  }
+
+  this._maxDataSizeExceeded = true;
+  var message =
+    'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
+  this.emit('error', new Error(message));
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/package.json	(revision 487)
@@ -0,0 +1,35 @@
+{
+  "author": {
+    "name": "Felix GeisendÃ¶rfer",
+    "email": "felix@debuggable.com",
+    "url": "http://debuggable.com/"
+  },
+  "name": "delayed-stream",
+  "description": "Buffers events from a stream until you are ready to handle them.",
+  "version": "0.0.5",
+  "homepage": "https://github.com/felixge/node-delayed-stream",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/felixge/node-delayed-stream.git"
+  },
+  "main": "./lib/delayed_stream",
+  "engines": {
+    "node": ">=0.4.0"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "fake": "0.2.0",
+    "far": "0.0.1"
+  },
+  "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n  var delayed = DelayedStream.create(req);\n\n  setTimeout(function() {\n    res.writeHead(200);\n    delayed.pipe(res);\n  }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n  // Emit all buffered events and resume underlaying source\n  delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n",
+  "readmeFilename": "Readme.md",
+  "bugs": {
+    "url": "https://github.com/felixge/node-delayed-stream/issues"
+  },
+  "_id": "delayed-stream@0.0.5",
+  "dist": {
+    "shasum": "65fc527ce0503b527205f943369177a48e8932fd"
+  },
+  "_from": "delayed-stream@0.0.5",
+  "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-0.0.5.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/common.js	(revision 487)
@@ -0,0 +1,6 @@
+var common = module.exports;
+
+common.DelayedStream = require('..');
+common.assert = require('assert');
+common.fake = require('fake');
+common.PORT = 49252;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-http-upload.js	(revision 487)
@@ -0,0 +1,38 @@
+var common = require('../common');
+var assert = common.assert;
+var DelayedStream = common.DelayedStream;
+var http = require('http');
+
+var UPLOAD = new Buffer(10 * 1024 * 1024);
+
+var server = http.createServer(function(req, res) {
+  var delayed = DelayedStream.create(req, {maxDataSize: UPLOAD.length});
+
+  setTimeout(function() {
+    res.writeHead(200);
+    delayed.pipe(res);
+  }, 10);
+});
+server.listen(common.PORT, function() {
+  var request = http.request({
+    method: 'POST',
+    port: common.PORT,
+  });
+
+  request.write(UPLOAD);
+  request.end();
+
+  request.on('response', function(res) {
+    var received = 0;
+    res
+      .on('data', function(chunk) {
+        received += chunk.length;
+      })
+      .on('end', function() {
+        assert.equal(received, UPLOAD.length);
+        server.close();
+      });
+  });
+});
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-auto-pause.js	(revision 487)
@@ -0,0 +1,21 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testAutoPause() {
+  var source = new Stream();
+
+  fake.expect(source, 'pause', 1);
+  var delayedStream = DelayedStream.create(source);
+  fake.verify();
+})();
+
+(function testDisableAutoPause() {
+  var source = new Stream();
+  fake.expect(source, 'pause', 0);
+
+  var delayedStream = DelayedStream.create(source, {pauseStream: false});
+  fake.verify();
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream-pause.js	(revision 487)
@@ -0,0 +1,14 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testDelayEventsUntilResume() {
+  var source = new Stream();
+  var delayedStream = DelayedStream.create(source, {pauseStream: false});
+
+  fake.expect(source, 'pause');
+  delayedStream.pause();
+  fake.verify();
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-delayed-stream.js	(revision 487)
@@ -0,0 +1,48 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testDelayEventsUntilResume() {
+  var source = new Stream();
+  var delayedStream = DelayedStream.create(source, {pauseStream: false});
+
+  // delayedStream must not emit until we resume
+  fake.expect(delayedStream, 'emit', 0);
+
+  // but our original source must emit
+  var params = [];
+  source.on('foo', function(param) {
+    params.push(param);
+  });
+
+  source.emit('foo', 1);
+  source.emit('foo', 2);
+
+  // Make sure delayedStream did not emit, and source did
+  assert.deepEqual(params, [1, 2]);
+  fake.verify();
+
+  // After resume, delayedStream must playback all events
+  fake
+    .stub(delayedStream, 'emit')
+    .times(Infinity)
+    .withArg(1, 'newListener');
+  fake.expect(delayedStream, 'emit', ['foo', 1]);
+  fake.expect(delayedStream, 'emit', ['foo', 2]);
+  fake.expect(source, 'resume');
+
+  delayedStream.resume();
+  fake.verify();
+
+  // Calling resume again will delegate to source
+  fake.expect(source, 'resume');
+  delayedStream.resume();
+  fake.verify();
+
+  // Emitting more events directly leads to them being emitted
+  fake.expect(delayedStream, 'emit', ['foo', 3]);
+  source.emit('foo', 3);
+  fake.verify();
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-handle-source-errors.js	(revision 487)
@@ -0,0 +1,15 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testHandleSourceErrors() {
+  var source = new Stream();
+  var delayedStream = DelayedStream.create(source, {pauseStream: false});
+
+  // We deal with this by attaching a no-op listener to 'error' on the source
+  // when creating a new DelayedStream. This way error events on the source
+  // won't throw.
+  source.emit('error', new Error('something went wrong'));
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-max-data-size.js	(revision 487)
@@ -0,0 +1,18 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testMaxDataSize() {
+  var source = new Stream();
+  var delayedStream = DelayedStream.create(source, {maxDataSize: 1024, pauseStream: false});
+
+  source.emit('data', new Buffer(1024));
+
+  fake
+    .expect(delayedStream, 'emit')
+    .withArg(1, 'error');
+  source.emit('data', new Buffer(1));
+  fake.verify();
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-pipe-resumes.js	(revision 487)
@@ -0,0 +1,13 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testPipeReleases() {
+  var source = new Stream();
+  var delayedStream = DelayedStream.create(source, {pauseStream: false});
+
+  fake.expect(delayedStream, 'resume');
+  delayedStream.pipe(new Stream());
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/integration/test-proxy-readable.js	(revision 487)
@@ -0,0 +1,13 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var DelayedStream = common.DelayedStream;
+var Stream = require('stream').Stream;
+
+(function testProxyReadableProperty() {
+  var source = new Stream();
+  var delayedStream = DelayedStream.create(source, {pauseStream: false});
+
+  source.readable = fake.value('source.readable');
+  assert.strictEqual(delayedStream.readable, source.readable);
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/node_modules/delayed-stream/test/run.js	(revision 487)
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+var far = require('far').create();
+
+far.add(__dirname);
+far.include(/test-.*\.js$/);
+
+far.execute();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/package.json	(revision 487)
@@ -0,0 +1,32 @@
+{
+  "author": {
+    "name": "Felix GeisendÃ¶rfer",
+    "email": "felix@debuggable.com",
+    "url": "http://debuggable.com/"
+  },
+  "name": "combined-stream",
+  "description": "A stream that emits multiple other streams one after another.",
+  "version": "0.0.4",
+  "homepage": "https://github.com/felixge/node-combined-stream",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/felixge/node-combined-stream.git"
+  },
+  "main": "./lib/combined_stream",
+  "engines": {
+    "node": "*"
+  },
+  "dependencies": {
+    "delayed-stream": "0.0.5"
+  },
+  "devDependencies": {
+    "far": "0.0.1"
+  },
+  "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n  next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n  next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = true\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = 2 * 1024 * 1024\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = 0\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n",
+  "readmeFilename": "Readme.md",
+  "bugs": {
+    "url": "https://github.com/felixge/node-combined-stream/issues"
+  },
+  "_id": "combined-stream@0.0.4",
+  "_from": "combined-stream@~0.0.4"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/common.js	(revision 487)
@@ -0,0 +1,23 @@
+var common = module.exports;
+
+var path = require('path');
+var fs = require('fs');
+var root = path.join(__dirname, '..');
+
+common.dir = {
+  fixture: root + '/test/fixture',
+  tmp: root + '/test/tmp',
+};
+
+// Create tmp directory if it does not exist
+// Not using fs.exists so as to be node 0.6.x compatible
+try {
+  fs.statSync(common.dir.tmp);
+}
+catch (e) {
+  // Dir does not exist
+  fs.mkdirSync(common.dir.tmp);
+}
+
+common.CombinedStream = require(root);
+common.assert = require('assert');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file1.txt	(revision 487)
@@ -0,0 +1,256 @@
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
+10101010101010101010101010101010101010101010101010101010101010101010101010101010
+01010101010101010101010101010101010101010101010101010101010101010101010101010101
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/fixture/file2.txt	(revision 487)
@@ -0,0 +1,256 @@
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
+20202020202020202020202020202020202020202020202020202020202020202020202020202020
+02020202020202020202020202020202020202020202020202020202020202020202020202020202
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-callback-streams.js	(revision 487)
@@ -0,0 +1,27 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var fs = require('fs');
+
+var FILE1 = common.dir.fixture + '/file1.txt';
+var FILE2 = common.dir.fixture + '/file2.txt';
+var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
+
+(function testDelayedStreams() {
+  var combinedStream = CombinedStream.create();
+  combinedStream.append(function(next) {
+    next(fs.createReadStream(FILE1));
+  });
+  combinedStream.append(function(next) {
+    next(fs.createReadStream(FILE2));
+  });
+
+  var tmpFile = common.dir.tmp + '/combined.txt';
+  var dest = fs.createWriteStream(tmpFile);
+  combinedStream.pipe(dest);
+
+  dest.on('end', function() {
+    var written = fs.readFileSync(tmpFile, 'utf8');
+    assert.strictEqual(written, EXPECTED);
+  });
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-data-size.js	(revision 487)
@@ -0,0 +1,34 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+
+(function testDataSizeGetter() {
+  var combinedStream = CombinedStream.create();
+
+  assert.strictEqual(combinedStream.dataSize, 0);
+
+  // Test one stream
+  combinedStream._streams.push({dataSize: 10});
+  combinedStream._updateDataSize();
+  assert.strictEqual(combinedStream.dataSize, 10);
+
+  // Test two streams
+  combinedStream._streams.push({dataSize: 23});
+  combinedStream._updateDataSize();
+  assert.strictEqual(combinedStream.dataSize, 33);
+
+  // Test currentStream
+  combinedStream._currentStream = {dataSize: 20};
+  combinedStream._updateDataSize();
+  assert.strictEqual(combinedStream.dataSize, 53);
+
+  // Test currentStream without dataSize
+  combinedStream._currentStream = {};
+  combinedStream._updateDataSize();
+  assert.strictEqual(combinedStream.dataSize, 33);
+
+  // Test stream function
+  combinedStream._streams.push(function() {});
+  combinedStream._updateDataSize();
+  assert.strictEqual(combinedStream.dataSize, 33);
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams-and-buffers-and-strings.js	(revision 487)
@@ -0,0 +1,38 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var fs = require('fs');
+
+var FILE1 = common.dir.fixture + '/file1.txt';
+var BUFFER = new Buffer('Bacon is delicious');
+var FILE2 = common.dir.fixture + '/file2.txt';
+var STRING = 'The â¬ kicks the $\'s ass!';
+
+var EXPECTED =
+  fs.readFileSync(FILE1)
+  + BUFFER
+  + fs.readFileSync(FILE2)
+  + STRING;
+var GOT;
+
+(function testDelayedStreams() {
+  var combinedStream = CombinedStream.create();
+  combinedStream.append(fs.createReadStream(FILE1));
+  combinedStream.append(BUFFER);
+  combinedStream.append(fs.createReadStream(FILE2));
+  combinedStream.append(function(next) {
+    next(STRING);
+  });
+
+  var tmpFile = common.dir.tmp + '/combined-file1-buffer-file2-string.txt';
+  var dest = fs.createWriteStream(tmpFile);
+  combinedStream.pipe(dest);
+
+  dest.on('close', function() {
+    GOT = fs.readFileSync(tmpFile, 'utf8');
+  });
+})();
+
+process.on('exit', function() {
+  assert.strictEqual(GOT, EXPECTED);
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-delayed-streams.js	(revision 487)
@@ -0,0 +1,35 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var fs = require('fs');
+
+var FILE1 = common.dir.fixture + '/file1.txt';
+var FILE2 = common.dir.fixture + '/file2.txt';
+var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
+var GOT;
+
+(function testDelayedStreams() {
+  var combinedStream = CombinedStream.create();
+  combinedStream.append(fs.createReadStream(FILE1));
+  combinedStream.append(fs.createReadStream(FILE2));
+
+  var stream1 = combinedStream._streams[0];
+  var stream2 = combinedStream._streams[1];
+
+  stream1.on('end', function() {
+    assert.equal(stream2.dataSize, 0);
+  });
+
+  var tmpFile = common.dir.tmp + '/combined.txt';
+  var dest = fs.createWriteStream(tmpFile);
+  combinedStream.pipe(dest);
+
+  dest.on('close', function() {
+    GOT = fs.readFileSync(tmpFile, 'utf8');
+  });
+})();
+
+process.on('exit', function() {
+  console.error(GOT.length, EXPECTED.length);
+  assert.strictEqual(GOT, EXPECTED);
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-empty-string.js	(revision 487)
@@ -0,0 +1,39 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var util = require('util');
+var Stream = require('stream').Stream;
+
+var s = CombinedStream.create();
+
+
+function StringStream(){
+  this.writable=true;
+  this.str=""
+}
+util.inherits(StringStream,Stream);
+
+StringStream.prototype.write=function(chunk,encoding){
+  this.str+=chunk.toString();
+  this.emit('data',chunk);
+}
+
+StringStream.prototype.end=function(chunk,encoding){
+  this.emit('end');
+}
+
+StringStream.prototype.toString=function(){
+  return this.str;
+}
+
+
+s.append("foo.");
+s.append("");
+s.append("bar");
+
+var ss = new StringStream();
+
+s.pipe(ss);
+s.resume();
+
+assert.equal(ss.toString(),"foo.bar");
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-is-stream-like.js	(revision 487)
@@ -0,0 +1,17 @@
+var fs = require('fs');
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var FILE1 = common.dir.fixture + '/file1.txt';
+var fileStream = fs.createReadStream(FILE1);
+
+var foo = function(){};
+
+(function testIsStreamLike() {
+  assert(! CombinedStream.isStreamLike(true));
+  assert(! CombinedStream.isStreamLike("I am a string"));
+  assert(! CombinedStream.isStreamLike(7));
+  assert(! CombinedStream.isStreamLike(foo));
+
+  assert(CombinedStream.isStreamLike(fileStream));
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-max-data-size.js	(revision 487)
@@ -0,0 +1,24 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var fs = require('fs');
+
+var FILE1 = common.dir.fixture + '/file1.txt';
+var FILE2 = common.dir.fixture + '/file2.txt';
+var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
+
+(function testDelayedStreams() {
+  var combinedStream = CombinedStream.create({pauseStreams: false, maxDataSize: 20736});
+  combinedStream.append(fs.createReadStream(FILE1));
+  combinedStream.append(fs.createReadStream(FILE2));
+
+  var gotErr = null;
+  combinedStream.on('error', function(err) {
+    gotErr = err;
+  });
+
+  process.on('exit', function() {
+    assert.ok(gotErr);
+    assert.ok(gotErr.message.match(/bytes/));
+  });
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/integration/test-unpaused-streams.js	(revision 487)
@@ -0,0 +1,30 @@
+var common = require('../common');
+var assert = common.assert;
+var CombinedStream = common.CombinedStream;
+var fs = require('fs');
+
+var FILE1 = common.dir.fixture + '/file1.txt';
+var FILE2 = common.dir.fixture + '/file2.txt';
+var EXPECTED = fs.readFileSync(FILE1) + fs.readFileSync(FILE2);
+
+(function testDelayedStreams() {
+  var combinedStream = CombinedStream.create({pauseStreams: false});
+  combinedStream.append(fs.createReadStream(FILE1));
+  combinedStream.append(fs.createReadStream(FILE2));
+
+  var stream1 = combinedStream._streams[0];
+  var stream2 = combinedStream._streams[1];
+
+  stream1.on('end', function() {
+    assert.ok(stream2.dataSize > 0);
+  });
+
+  var tmpFile = common.dir.tmp + '/combined.txt';
+  var dest = fs.createWriteStream(tmpFile);
+  combinedStream.pipe(dest);
+
+  dest.on('end', function() {
+    var written = fs.readFileSync(tmpFile, 'utf8');
+    assert.strictEqual(written, EXPECTED);
+  });
+})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/node_modules/combined-stream/test/run.js	(revision 487)
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+var far = require('far').create();
+
+far.add(__dirname);
+far.include(/test-.*\.js$/);
+
+far.execute();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/form-data/package.json	(revision 487)
@@ -0,0 +1,46 @@
+{
+  "author": {
+    "name": "Felix GeisendÃ¶rfer",
+    "email": "felix@debuggable.com",
+    "url": "http://debuggable.com/"
+  },
+  "name": "form-data",
+  "description": "A module to create readable \"multipart/form-data\" streams.  Can be used to submit forms and file uploads to other web applications.",
+  "version": "0.1.2",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/felixge/node-form-data.git"
+  },
+  "main": "./lib/form_data",
+  "scripts": {
+    "test": "node test/run.js"
+  },
+  "engines": {
+    "node": ">= 0.6"
+  },
+  "dependencies": {
+    "combined-stream": "~0.0.4",
+    "mime": "~1.2.11",
+    "async": "~0.2.9"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://raw.github.com/felixge/node-form-data/master/License"
+    }
+  ],
+  "devDependencies": {
+    "fake": "~0.2.2",
+    "far": "~0.0.7",
+    "formidable": "~1.0.14",
+    "request": "~2.27.0"
+  },
+  "readme": "# Form-Data [![Build Status](https://travis-ci.org/felixge/node-form-data.png?branch=master)](https://travis-ci.org/felixge/node-form-data) [![Dependency Status](https://gemnasium.com/felixge/node-form-data.png)](https://gemnasium.com/felixge/node-form-data)\n\nA module to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this module is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n  form.append('my_field', 'my value');\n  form.append('my_buffer', new Buffer(10));\n  form.append('my_logo', response);\n});\n```\n\nOr @mikeal's request stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n  // res â response object (http.IncomingMessage)  //\n  res.resume(); // for node-0.10.x\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n  method: 'post',\n  host: 'example.org',\n  path: '/upload',\n  headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n  console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n  console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n  header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n  knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n  if (err) throw err;\n  console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n  if (err) throw err;\n\n  var form = new FormData();\n\n  form.append('file', stdout, {\n    filename: 'unicycle.jpg',\n    contentType: 'image/jpg',\n    knownLength: 19806\n  });\n\n  form.submit('http://example.com/', function(err, res) {\n    if (err) throw err;\n    console.log('Done');\n  });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n  host: 'example.com',\n  path: '/probably.php?extra=params',\n  auth: 'username:password'\n}, function(err, res) {\n  console.log(res.statusCode);\n});\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## TODO\n\n- Add new streams (0.10) support and try really hard not to break it for 0.8.x.\n\n## License\n\nForm-Data is licensed under the MIT license.\n",
+  "readmeFilename": "Readme.md",
+  "bugs": {
+    "url": "https://github.com/felixge/node-form-data/issues"
+  },
+  "homepage": "https://github.com/felixge/node-form-data",
+  "_id": "form-data@0.1.2",
+  "_from": "form-data@~0.1.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/.npmignore	(revision 487)
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/.travis.yml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/.travis.yml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/.travis.yml	(revision 487)
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+  - 0.10
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/LICENSE	(revision 487)
@@ -0,0 +1,24 @@
+Copyright (c) 2012-2013, Eran Hammer.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Eran Hammer nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/Makefile	(revision 487)
@@ -0,0 +1,10 @@
+test:
+	@node node_modules/lab/bin/lab
+test-cov: 
+	@node node_modules/lab/bin/lab -r threshold -t 100
+test-cov-html:
+	@node node_modules/lab/bin/lab -r html -o coverage.html
+complexity:
+	@node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib
+
+.PHONY: test test-cov test-cov-html complexity
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/README.md	(revision 487)
@@ -0,0 +1,627 @@
+![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png)
+
+<img align="right" src="https://raw.github.com/hueniverse/hawk/master/images/logo.png" /> **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial
+HTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz).
+
+Current version: **1.0**
+
+[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk)
+
+# Table of Content
+
+- [**Introduction**](#introduction)
+  - [Replay Protection](#replay-protection)
+  - [Usage Example](#usage-example)
+  - [Protocol Example](#protocol-example)
+    - [Payload Validation](#payload-validation)
+    - [Response Payload Validation](#response-payload-validation)
+  - [Browser Support and Considerations](#browser-support-and-considerations)
+<p></p>
+- [**Single URI Authorization**](#single-uri-authorization)
+  - [Usage Example](#bewit-usage-example)
+<p></p>
+- [**Security Considerations**](#security-considerations)
+  - [MAC Keys Transmission](#mac-keys-transmission)
+  - [Confidentiality of Requests](#confidentiality-of-requests)
+  - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers)
+  - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials)
+  - [Entropy of Keys](#entropy-of-keys)
+  - [Coverage Limitations](#coverage-limitations)
+  - [Future Time Manipulation](#future-time-manipulation)
+  - [Client Clock Poisoning](#client-clock-poisoning)
+  - [Bewit Limitations](#bewit-limitations)
+  - [Host Header Forgery](#host-header-forgery)
+<p></p>
+- [**Frequently Asked Questions**](#frequently-asked-questions)
+<p></p>
+- [**Acknowledgements**](#acknowledgements)
+
+# Introduction
+
+**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with
+partial cryptographic verification of the request and response, covering the HTTP method, request URI, host,
+and optionally the request payload.
+
+Similar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of
+client credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme,
+the key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is
+included in its place.
+
+However, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of
+replay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less
+"chattiness" (interaction with the server).
+
+Also unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because
+the client and server must both have access to the key material in the clear.
+
+The primary design goals of this scheme are to:
+* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources,
+* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where
+  to send an authenticated request), and
+* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client
+  failure to validate the server's identity as part of its TLS handshake.
+
+In addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using
+a query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk).
+
+The **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server,
+which is beyond the scope of this module. Typically, the shared credentials are established via an initial
+TLS-protected phase or derived from some other shared confidential information available to both the client
+and the server.
+
+
+## Replay Protection
+
+Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more 
+than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when 
+making requests. This gives the server enough information to prevent replay attacks.
+
+The nonce is generated by the client, and is a string unique across all requests with the same timestamp and
+key identifier combination. 
+
+The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards
+are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.
+By default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in
+practice translates to a maximum of 2 minutes as the skew can be positive or negative).
+
+Using a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client
+clock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types
+(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response
+to a bad timestamp.
+
+There is no expectation that the client will adjust its system clock to match the server (in fact, this would be a
+potential attack vector). Instead, the client only uses the server's time to calculate an offset used only
+for communications with that particular server. The protocol rewards clients with synchronized clocks by reducing
+the number of round trips required to authenticate the first request.
+
+
+## Usage Example
+
+Server code:
+
+```javascript
+var Http = require('http');
+var Hawk = require('hawk');
+
+
+// Credentials lookup function
+
+var credentialsFunc = function (id, callback) {
+
+    var credentials = {
+        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+        algorithm: 'sha256',
+        user: 'Steve'
+    };
+
+    return callback(null, credentials);
+};
+
+// Create HTTP server
+
+var handler = function (req, res) {
+
+    // Authenticate incoming request
+
+    Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+        // Prepare response
+
+        var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');
+        var headers = { 'Content-Type': 'text/plain' };
+
+        // Generate Server-Authorization response header
+
+        var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] });
+        headers['Server-Authorization'] = header;
+
+        // Send the response back
+
+        res.writeHead(!err ? 200 : 401, headers);
+        res.end(payload);
+    });
+};
+
+// Start server
+
+Http.createServer(handler).listen(8000, 'example.com');
+```
+
+Client code:
+
+```javascript
+var Request = require('request');
+var Hawk = require('hawk');
+
+
+// Client credentials
+
+var credentials = {
+    id: 'dh37fgj492je',
+    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+    algorithm: 'sha256'
+}
+
+// Request options
+
+var requestOptions = {
+    uri: 'http://example.com:8000/resource/1?b=1&a=2',
+    method: 'GET',
+    headers: {}
+};
+
+// Generate Authorization request header
+
+var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' });
+requestOptions.headers.Authorization = header.field;
+
+// Send authenticated request
+
+Request(requestOptions, function (error, response, body) {
+
+    // Authenticate the server's response
+
+    var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });
+
+    // Output results
+
+    console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));
+});
+```
+
+**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local
+machine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method.
+
+```javascript
+Hawk.sntp.start();
+```
+
+
+## Protocol Example
+
+The client attempts to access a protected resource without authentication, sending the following HTTP request to
+the resource server:
+
+```
+GET /resource/1?b=1&a=2 HTTP/1.1
+Host: example.com:8000
+```
+
+The resource server returns an authentication challenge.
+
+```
+HTTP/1.1 401 Unauthorized
+WWW-Authenticate: Hawk
+```
+
+The client has previously obtained a set of **Hawk** credentials for accessing resources on the "http://example.com/"
+server. The **Hawk** credentials issued to the client include the following attributes:
+
+* Key identifier: dh37fgj492je
+* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn
+* Algorithm: sha256
+
+The client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1,
+1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline
+character):
+
+```
+hawk.1.header
+1353832234
+j4h3g2
+GET
+/resource/1?b=1&a=2
+example.com
+8000
+
+some-app-ext-data
+
+```
+
+The request MAC is calculated using HMAC with the specified hash algorithm "sha256" and the key over the normalized request string.
+The result is base64-encoded to produce the request MAC:
+
+```
+6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=
+```
+
+The client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using
+the HTTP `Authorization` request header field:
+
+```
+GET /resource/1?b=1&a=2 HTTP/1.1
+Host: example.com:8000
+Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="
+```
+
+The server validates the request by calculating the request MAC again based on the request received and verifies the validity
+and scope of the **Hawk** credentials. If valid, the server responds with the requested resource.
+
+
+### Payload Validation
+
+**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash
+using the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character):
+* `hawk.1.payload`
+* the content-type in lowercase, without any parameters (e.g. `application/json`)
+* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability)
+
+For example:
+
+* Payload: `Thank you for flying Hawk`
+* Content Type: `text/plain`
+* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=`
+
+Results in the following input to the payload hash function (newline terminated values):
+
+```
+hawk.1.payload
+text/plain
+Thank you for flying Hawk
+
+```
+
+Which produces the following hash value:
+
+```
+Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=
+```
+
+The client constructs the normalized request string (newline terminated values):
+
+```
+hawk.1.header
+1353832234
+j4h3g2
+POST
+/resource/1?a=1&b=2
+example.com
+8000
+Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=
+some-app-ext-data
+
+```
+
+Then calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data,
+and request MAC, with the request using the HTTP `Authorization` request header field:
+
+```
+POST /resource/1?a=1&b=2 HTTP/1.1
+Host: example.com:8000
+Authorization: Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw="
+```
+
+It is up to the server if and when it validates the payload for any given request, based solely on it's security policy
+and the nature of the data included.
+
+If the payload is available at the time of authentication, the server uses the hash value provided by the client to construct
+the normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value
+with the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash.
+
+However, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed
+at a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value
+provided by the client after validating the MAC.
+
+It is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value
+included in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided
+by the client, the payload may be modified by an attacker.
+
+
+## Response Payload Validation
+
+**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the
+client to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header
+as a response header using the exact same syntax as the `Authorization` request header field.
+
+The header is contructed using the same process as the client's request header. The server uses the same credentials and other
+artifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with
+new values based on the server response. The rest as identical to those used by the client.
+
+The result MAC digest is included with the optional `hash` and `ext` values:
+
+```
+Server-Authorization: Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"
+```
+
+
+## Browser Support and Considerations
+
+A browser script is provided for including using a `<script>` tag in [lib/browser.js](/lib/browser.js).
+
+**Hawk** relies on the _Server-Authorization_ and _WWW-Authenticate_ headers in its response to communicate with the client.
+Therefore, in case of CORS requests, it is important to consider sending _Access-Control-Expose-Headers_ with the value
+_"WWW-Authenticate, Server-Authorization"_ on each response from your server. As explained in the
+[specifications](http://www.w3.org/TR/cors/#access-control-expose-headers-response-header), it will indicate that these headers
+can safely be accessed by the client (using getResponseHeader() on the XmlHttpRequest object). Otherwise you will be met with a
+["simple response header"](http://www.w3.org/TR/cors/#simple-response-header) which excludes these fields and would prevent the
+Hawk client from authenticating the requests.You can read more about the why and how in this
+[article](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)
+
+
+# Single URI Authorization
+
+There are cases in which limited and short-term access to a protected resource is granted to a third party which does not
+have access to the shared credentials. For example, displaying a protected image on a web page accessed by anyone. **Hawk**
+provides limited support for such URIs in the form of a _bewit_ - a URI query parameter appended to the request URI which contains
+the necessary credentials to authenticate the request.
+
+Because of the significant security risks involved in issuing such access, bewit usage is purposely limited only to GET requests
+and for a finite period of time. Both the client and server can issue bewit credentials, however, the server should not use the same
+credentials as the client to maintain clear traceability as to who issued which credentials.
+
+In order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within
+the granted access timeframe. 
+
+
+## Bewit Usage Example
+
+Server code:
+
+```javascript
+var Http = require('http');
+var Hawk = require('hawk');
+
+
+// Credentials lookup function
+
+var credentialsFunc = function (id, callback) {
+
+    var credentials = {
+        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+        algorithm: 'sha256'
+    };
+
+    return callback(null, credentials);
+};
+
+// Create HTTP server
+
+var handler = function (req, res) {
+
+    Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+        res.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' });
+        res.end(!err ? 'Access granted' : 'Shoosh!');
+    });
+};
+
+Http.createServer(handler).listen(8000, 'example.com');
+```
+
+Bewit code generation:
+
+```javascript
+var Request = require('request');
+var Hawk = require('hawk');
+
+
+// Client credentials
+
+var credentials = {
+    id: 'dh37fgj492je',
+    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+    algorithm: 'sha256'
+}
+
+// Generate bewit
+
+var duration = 60 * 5;      // 5 Minutes
+var bewit = Hawk.uri.getBewit('http://example.com:8080/resource/1?b=1&a=2', { credentials: credentials, ttlSec: duration, ext: 'some-app-data' });
+var uri = 'http://example.com:8000/resource/1?b=1&a=2' + '&bewit=' + bewit;
+```
+
+
+# Security Considerations
+
+The greatest sources of security risks are usually found not in **Hawk** but in the policies and procedures surrounding its use.
+Implementers are strongly encouraged to assess how this module addresses their security requirements. This section includes
+an incomplete list of security considerations that must be reviewed and understood before deploying **Hawk** on the server.
+Many of the protections provided in **Hawk** depends on whether and how they are used.
+
+### MAC Keys Transmission
+
+**Hawk** does not provide any mechanism for obtaining or transmitting the set of shared credentials required. Any mechanism used
+to obtain **Hawk** credentials must ensure that these transmissions are protected using transport-layer mechanisms such as TLS.
+
+### Confidentiality of Requests
+
+While **Hawk** provides a mechanism for verifying the integrity of HTTP requests, it provides no guarantee of request
+confidentiality. Unless other precautions are taken, eavesdroppers will have full access to the request content. Servers should
+carefully consider the types of data likely to be sent as part of such requests, and employ transport-layer security mechanisms
+to protect sensitive resources.
+
+### Spoofing by Counterfeit Servers
+
+**Hawk** provides limited verification of the server authenticity. When receiving a response back from the server, the server
+may choose to include a response `Server-Authorization` header which the client can use to verify the response. However, it is up to
+the server to determine when such measure is included, to up to the client to enforce that policy.
+
+A hostile party could take advantage of this by intercepting the client's requests and returning misleading or otherwise
+incorrect responses. Service providers should consider such attacks when developing services using this protocol, and should
+require transport-layer security for any requests where the authenticity of the resource server or of server responses is an issue.
+
+### Plaintext Storage of Credentials
+
+The **Hawk** key functions the same way passwords do in traditional authentication systems. In order to compute the request MAC,
+the server must have access to the key in plaintext form. This is in contrast, for example, to modern operating systems, which
+store only a one-way hash of user credentials.
+
+If an attacker were to gain access to these keys - or worse, to the server's database of all such keys - he or she would be able
+to perform any action on behalf of any resource owner. Accordingly, it is critical that servers protect these keys from unauthorized
+access.
+
+### Entropy of Keys
+
+Unless a transport-layer security protocol is used, eavesdroppers will have full access to authenticated requests and request
+MAC values, and will thus be able to mount offline brute-force attacks to recover the key used. Servers should be careful to
+assign keys which are long enough, and random enough, to resist such attacks for at least the length of time that the **Hawk**
+credentials are valid.
+
+For example, if the credentials are valid for two weeks, servers should ensure that it is not possible to mount a brute force
+attack that recovers the key in less than two weeks. Of course, servers are urged to err on the side of caution, and use the
+longest key reasonable.
+
+It is equally important that the pseudo-random number generator (PRNG) used to generate these keys be of sufficiently high
+quality. Many PRNG implementations generate number sequences that may appear to be random, but which nevertheless exhibit
+patterns or other weaknesses which make cryptanalysis or brute force attacks easier. Implementers should be careful to use
+cryptographically secure PRNGs to avoid these problems.
+
+### Coverage Limitations
+
+The request MAC only covers the HTTP `Host` header and optionally the `Content-Type` header. It does not cover any other headers
+which can often affect how the request body is interpreted by the server. If the server behavior is influenced by the presence
+or value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the
+`ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.
+
+The response authentication, when performed, only covers the response payload, content-type, and the request information 
+provided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or
+any other response header field (e.g. Location) which can affect the client's behaviour.
+
+### Future Time Manipulation
+
+The protocol relies on a clock sync between the client and server. To accomplish this, the server informs the client of its
+current time when an invalid timestamp is received.
+
+If an attacker is able to manipulate this information and cause the client to use an incorrect time, it would be able to cause
+the client to generate authenticated requests using time in the future. Such requests will fail when sent by the client, and will
+not likely leave a trace on the server (given the common implementation of nonce, if at all enforced). The attacker will then
+be able to replay the request at the correct time without detection.
+
+The client must only use the time information provided by the server if:
+* it was delivered over a TLS connection and the server identity has been verified, or
+* the `tsm` MAC digest calculated using the same client credentials over the timestamp has been verified.
+
+### Client Clock Poisoning
+
+When receiving a request with a bad timestamp, the server provides the client with its current time. The client must never use
+the time received from the server to adjust its own clock, and must only use it to calculate an offset for communicating with
+that particular server.
+
+### Bewit Limitations
+
+Special care must be taken when issuing bewit credentials to third parties. Bewit credentials are valid until expiration and cannot
+be revoked or limited without using other means. Whatever resource they grant access to will be completely exposed to anyone with
+access to the bewit credentials which act as bearer credentials for that particular resource. While bewit usage is limited to GET
+requests only and therefore cannot be used to perform transactions or change server state, it can still be used to expose private
+and sensitive information.
+
+### Host Header Forgery
+
+Hawk validates the incoming request MAC against the incoming HTTP Host header. However, unless the optional `host` and `port`
+options are used with `server.authenticate()`, a malicous client can mint new host names pointing to the server's IP address and
+use that to craft an attack by sending a valid request that's meant for another hostname than the one used by the server. Server
+implementors must manually verify that the host header received matches their expectation (or use the options mentioned above).
+
+# Frequently Asked Questions
+
+### Where is the protocol specification?
+
+If you are looking for some prose explaining how all this works, **this is it**. **Hawk** is being developed as an open source
+project instead of a standard. In other words, the [code](/hueniverse/hawk/tree/master/lib) is the specification. Not sure about
+something? Open an issue!
+
+### Is it done?
+
+At if version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental
+and is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions
+and suggestions.
+
+### Where can I find **Hawk** implementations in other languages?
+
+**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, others are actively porting it to other
+platforms. There is already a [PHP](https://github.com/alexbilbie/PHP-Hawk),
+[.NET](https://github.com/pcibraro/hawknet), and [JAVA](https://github.com/wealdtech/hawk) libraries available. The full list
+is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port). Please add an issue if you are working on another
+port. A cross-platform test-suite is in the works.
+
+### Why isn't the algorithm part of the challenge or dynamically negotiated?
+
+The algorithm used is closely related to the key issued as different algorithms require different key sizes (and other
+requirements). While some keys can be used for multiple algorithm, the protocol is designed to closely bind the key and algorithm
+together as part of the issued credentials.
+
+### Why is Host and Content-Type the only headers covered by the request MAC?
+
+It is really hard to include other headers. Headers can be changed by proxies and other intermediaries and there is no
+well-established way to normalize them. Many platforms change the case of header field names and values. The only
+straight-forward solution is to include the headers in some blob (say, base64 encoded JSON) and include that with the request,
+an approach taken by JWT and other such formats. However, that design violates the HTTP header boundaries, repeats information,
+and introduces other security issues because firewalls will not be aware of these "hidden" headers. In addition, any information
+repeated must be compared to the duplicated information in the header and therefore only moves the problem elsewhere.
+
+### Why not just use HTTP Digest?
+
+Digest requires pre-negotiation to establish a nonce. This means you can't just make a request - you must first send
+a protocol handshake to the server. This pattern has become unacceptable for most web services, especially mobile
+where extra round-trip are costly.
+
+### Why bother with all this nonce and timestamp business?
+
+**Hawk** is an attempt to find a reasonable, practical compromise between security and usability. OAuth 1.0 got timestamp
+and nonces halfway right but failed when it came to scalability and consistent developer experience. **Hawk** addresses
+it by requiring the client to sync its clock, but provides it with tools to accomplish it.
+
+In general, replay protection is a matter of application-specific threat model. It is less of an issue on a TLS-protected
+system where the clients are implemented using best practices and are under the control of the server. Instead of dropping
+replay protection, **Hawk** offers a required time window and an optional nonce verification. Together, it provides developers
+with the ability to decide how to enforce their security policy without impacting the client's implementation.
+
+### What are `app` and `dlg` in the authorization header and normalized mac string?
+
+The original motivation for **Hawk** was to replace the OAuth 1.0 use cases. This included both a simple client-server mode which
+this module is specifically designed for, and a delegated access mode which is being developed separately in
+[Oz](https://github.com/hueniverse/oz). In addition to the **Hawk** use cases, Oz requires another attribute: the application id `app`.
+This provides binding between the credentials and the application in a way that prevents an attacker from tricking an application
+to use credentials issued to someone else. It also has an optional 'delegated-by' attribute `dlg` which is the application id of the
+application the credentials were directly issued to. The goal of these two additions is to allow Oz to utilize **Hawk** directly,
+but with the additional security of delegated credentials.
+
+### What is the purpose of the static strings used in each normalized MAC input?
+
+When calculating a hash or MAC, a static prefix (tag) is added. The prefix is used to prevent MAC values from being
+used or reused for a purpose other than what they were created for (i.e. prevents switching MAC values between a request,
+response, and a bewit use cases). It also protects against expliots created after a potential change in how the protocol
+creates the normalized string. For example, if a future version would switch the order of nonce and timestamp, it
+can create an exploit opportunity for cases where the nonce is similar in format to a timestamp.
+
+### Does **Hawk** have anything to do with OAuth?
+
+Short answer: no.
+
+**Hawk** was originally proposed as the OAuth MAC Token specification. However, the OAuth working group in its consistent
+incompetence failed to produce a final, usable solution to address one of the most popular use cases of OAuth 1.0 - using it
+to authenticate simple client-server transactions (i.e. two-legged). As you can guess, the OAuth working group is still hard
+at work to produce more garbage.
+
+**Hawk** provides a simple HTTP authentication scheme for making client-server requests. It does not address the OAuth use case
+of delegating access to a third party. If you are looking for an OAuth alternative, check out [Oz](https://github.com/hueniverse/oz).
+
+
+# Acknowledgements
+
+**Hawk** is a derivative work of the [HTTP MAC Authentication Scheme](http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05) proposal
+co-authored by Ben Adida, Adam Barth, and Eran Hammer, which in turn was based on the OAuth 1.0 community specification.
+
+Special thanks to Ben Laurie for his always insightful feedback and advice.
+
+The **Hawk** logo was created by [Chris Carrasco](http://chriscarrasco.com).
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/example/usage.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/example/usage.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/example/usage.js	(revision 487)
@@ -0,0 +1,78 @@
+// Load modules
+
+var Http = require('http');
+var Request = require('request');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {
+    credentials: {
+        dh37fgj492je: {
+            id: 'dh37fgj492je',                                             // Required by Hawk.client.header 
+            key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+            algorithm: 'sha256',
+            user: 'Steve'
+        }
+    }
+};
+
+
+// Credentials lookup function
+
+var credentialsFunc = function (id, callback) {
+
+    return callback(null, internals.credentials[id]);
+};
+
+
+// Create HTTP server
+
+var handler = function (req, res) {
+
+    Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+        var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');
+        var headers = {
+            'Content-Type': 'text/plain',
+            'Server-Authorization': Hawk.server.header(credentials, artifacts, { payload: payload, contentType: 'text/plain' })
+        };
+
+        res.writeHead(!err ? 200 : 401, headers);
+        res.end(payload);
+    });
+};
+
+Http.createServer(handler).listen(8000, '127.0.0.1');
+
+
+// Send unauthenticated request
+
+Request('http://127.0.0.1:8000/resource/1?b=1&a=2', function (error, response, body) {
+
+    console.log(response.statusCode + ': ' + body);
+});
+
+
+// Send authenticated request
+
+credentialsFunc('dh37fgj492je', function (err, credentials) {
+
+    var header = Hawk.client.header('http://127.0.0.1:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'and welcome!' });
+    var options = {
+        uri: 'http://127.0.0.1:8000/resource/1?b=1&a=2',
+        method: 'GET',
+        headers: {
+            authorization: header.field
+        }
+    };
+
+    Request(options, function (error, response, body) {
+
+        var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });
+        console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));
+        process.exit(0);
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/index.js	(revision 487)
@@ -0,0 +1,1 @@
+module.exports = require('./lib');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/browser.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/browser.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/browser.js	(revision 487)
@@ -0,0 +1,485 @@
+/*
+    HTTP Hawk Authentication Scheme
+    Copyright (c) 2012-2013, Eran Hammer <eran@hueniverse.com>
+    MIT Licensed
+*/
+
+
+// Declare namespace
+
+var hawk = {};
+
+
+// Export if used as a module
+
+if (typeof module !== "undefined" && module.exports) {
+    module.exports = hawk;
+}
+
+hawk.client = {
+
+    // Generate an Authorization header for a given request
+
+    /*
+        uri: 'http://example.com/resource?a=b'
+        method: HTTP verb (e.g. 'GET', 'POST')
+        options: {
+    
+            // Required
+    
+            credentials: {
+                id: 'dh37fgj492je',
+                key: 'aoijedoaijsdlaksjdl',
+                algorithm: 'sha256'                                 // 'sha1', 'sha256'
+            },
+    
+            // Optional
+    
+            ext: 'application-specific',                        // Application specific data sent via the ext attribute
+            timestamp: Date.now() / 1000,                       // A pre-calculated timestamp in seconds
+            nonce: '2334f34f',                                  // A pre-generated nonce
+            localtimeOffsetMsec: 400,                           // Time offset to sync with server time (ignored if timestamp provided)
+            payload: '{"some":"payload"}',                      // UTF-8 encoded string for body hash generation (ignored if hash provided)
+            contentType: 'application/json',                    // Payload content-type (ignored if hash provided)
+            hash: 'U4MKKSmiVxk37JCCrAVIjV=',                    // Pre-calculated payload hash
+            app: '24s23423f34dx',                               // Oz application id
+            dlg: '234sz34tww3sd'                                // Oz delegated-by application id
+        }
+    */
+
+    header: function (uri, method, options) {
+
+        var result = {
+            field: '',
+            artifacts: {}
+        };
+
+        // Validate inputs
+
+        if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
+            !method || typeof method !== 'string' ||
+            !options || typeof options !== 'object') {
+
+            return result;
+        }
+
+        // Application time
+
+        var timestamp = options.timestamp || Math.floor((hawk.utils.now() + (options.localtimeOffsetMsec || 0)) / 1000)
+
+        // Validate credentials
+
+        var credentials = options.credentials;
+        if (!credentials ||
+            !credentials.id ||
+            !credentials.key ||
+            !credentials.algorithm) {
+
+            // Invalid credential object
+            return result;
+        }
+
+        if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+            return result;
+        }
+
+        // Parse URI
+
+        if (typeof uri === 'string') {
+            uri = hawk.utils.parseUri(uri);
+        }
+
+        // Calculate signature
+
+        var artifacts = {
+            ts: timestamp,
+            nonce: options.nonce || hawk.utils.randomString(6),
+            method: method,
+            resource: uri.relative,
+            host: uri.hostname,
+            port: uri.port,
+            hash: options.hash,
+            ext: options.ext,
+            app: options.app,
+            dlg: options.dlg
+        };
+
+        result.artifacts = artifacts;
+
+        // Calculate payload hash
+
+        if (!artifacts.hash &&
+            options.hasOwnProperty('payload')) {
+
+            artifacts.hash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+        }
+
+        var mac = hawk.crypto.calculateMac('header', credentials, artifacts);
+
+        // Construct header
+
+        var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '';       // Other falsey values allowed
+        var header = 'Hawk id="' + credentials.id +
+                     '", ts="' + artifacts.ts +
+                     '", nonce="' + artifacts.nonce +
+                     (artifacts.hash ? '", hash="' + artifacts.hash : '') +
+                     (hasExt ? '", ext="' + hawk.utils.escapeHeaderAttribute(artifacts.ext) : '') +
+                     '", mac="' + mac + '"';
+
+        if (artifacts.app) {
+            header += ', app="' + artifacts.app +
+                      (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
+        }
+
+        result.field = header;
+
+        return result;
+    },
+
+
+    // Validate server response
+
+    /*
+        request:    object created via 'new XMLHttpRequest()' after response received
+        artifacts:  object recieved from header().artifacts
+        options: {
+            payload:    optional payload received
+            required:   specifies if a Server-Authorization header is required. Defaults to 'false'
+        }
+    */
+
+    authenticate: function (request, credentials, artifacts, options) {
+
+        options = options || {};
+
+        if (request.getResponseHeader('www-authenticate')) {
+
+            // Parse HTTP WWW-Authenticate header
+
+            var attributes = hawk.utils.parseAuthorizationHeader(request.getResponseHeader('www-authenticate'), ['ts', 'tsm', 'error']);
+            if (!attributes) {
+                return false;
+            }
+
+            if (attributes.ts) {
+                var tsm = hawk.crypto.calculateTsMac(attributes.ts, credentials);
+                if (tsm !== attributes.tsm) {
+                    return false;
+                }
+
+                hawk.utils.setNtpOffset(attributes.ts - Math.floor(Date.now() / 1000));     // Keep offset at 1 second precision
+            }
+        }
+
+        // Parse HTTP Server-Authorization header
+
+        if (!request.getResponseHeader('server-authorization') &&
+            !options.required) {
+
+            return true;
+        }
+
+        var attributes = hawk.utils.parseAuthorizationHeader(request.getResponseHeader('server-authorization'), ['mac', 'ext', 'hash']);
+        if (!attributes) {
+            return false;
+        }
+
+        var modArtifacts = {
+            ts: artifacts.ts,
+            nonce: artifacts.nonce,
+            method: artifacts.method,
+            resource: artifacts.resource,
+            host: artifacts.host,
+            port: artifacts.port,
+            hash: attributes.hash,
+            ext: attributes.ext,
+            app: artifacts.app,
+            dlg: artifacts.dlg
+        };
+
+        var mac = hawk.crypto.calculateMac('response', credentials, modArtifacts);
+        if (mac !== attributes.mac) {
+            return false;
+        }
+
+        if (!options.hasOwnProperty('payload')) {
+            return true;
+        }
+
+        if (!attributes.hash) {
+            return false;
+        }
+
+        var calculatedHash = hawk.crypto.calculatePayloadHash(options.payload, credentials.algorithm, request.getResponseHeader('content-type'));
+        return (calculatedHash === attributes.hash);
+    },
+
+    message: function (host, port, message, options) {
+
+        // Validate inputs
+
+        if (!host || typeof host !== 'string' ||
+            !port || typeof port !== 'number' ||
+            message === null || message === undefined || typeof message !== 'string' ||
+            !options || typeof options !== 'object') {
+
+            return null;
+        }
+
+        // Application time
+
+        var timestamp = options.timestamp || Math.floor((hawk.utils.now() + (options.localtimeOffsetMsec || 0)) / 1000)
+
+        // Validate credentials
+
+        var credentials = options.credentials;
+        if (!credentials ||
+            !credentials.id ||
+            !credentials.key ||
+            !credentials.algorithm) {
+
+            // Invalid credential object
+            return null;
+        }
+
+        if (hawk.crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+            return null;
+        }
+
+        // Calculate signature
+
+        var artifacts = {
+            ts: timestamp,
+            nonce: options.nonce || hawk.utils.randomString(6),
+            host: host,
+            port: port,
+            hash: hawk.crypto.calculatePayloadHash(message, credentials.algorithm)
+        };
+
+        // Construct authorization
+
+        var result = {
+            id: credentials.id,
+            ts: artifacts.ts,
+            nonce: artifacts.nonce,
+            hash: artifacts.hash,
+            mac: hawk.crypto.calculateMac('message', credentials, artifacts)
+        };
+
+        return result;
+    }
+};
+
+
+hawk.crypto = {
+
+    headerVersion: '1',
+
+    algorithms: ['sha1', 'sha256'],
+
+    calculateMac: function (type, credentials, options) {
+
+        var normalized = hawk.crypto.generateNormalizedString(type, options);
+
+        var hmac = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()](normalized, credentials.key);
+        return hmac.toString(CryptoJS.enc.Base64);
+    },
+
+    generateNormalizedString: function (type, options) {
+
+        var normalized = 'hawk.' + hawk.crypto.headerVersion + '.' + type + '\n' +
+                         options.ts + '\n' +
+                         options.nonce + '\n' +
+                         (options.method || '').toUpperCase() + '\n' +
+                         (options.resource || '') + '\n' +
+                         options.host.toLowerCase() + '\n' +
+                         options.port + '\n' +
+                         (options.hash || '') + '\n';
+
+        if (options.ext) {
+            normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
+        }
+
+        normalized += '\n';
+
+        if (options.app) {
+            normalized += options.app + '\n' +
+                          (options.dlg || '') + '\n';
+        }
+
+        return normalized;
+    },
+
+    calculatePayloadHash: function (payload, algorithm, contentType) {
+
+        var hash = CryptoJS.algo[algorithm.toUpperCase()].create();
+        hash.update('hawk.' + hawk.crypto.headerVersion + '.payload\n');
+        hash.update(hawk.utils.parseContentType(contentType) + '\n');
+        hash.update(payload || '');
+        hash.update('\n');
+        return hash.finalize().toString(CryptoJS.enc.Base64);
+    },
+
+    calculateTsMac: function (ts, credentials) {
+
+        var hash = CryptoJS['Hmac' + credentials.algorithm.toUpperCase()]('hawk.' + hawk.crypto.headerVersion + '.ts\n' + ts + '\n', credentials.key);
+        return hash.toString(CryptoJS.enc.Base64);
+    }
+};
+
+
+hawk.utils = {
+
+    storage: {                                      // localStorage compatible interface
+        _cache: {},
+        setItem: function (key, value) {
+
+            hawk.utils.storage._cache[key] = value;
+        },
+        getItem: function (key) {
+
+            return hawk.utils.storage._cache[key];
+        }
+    },
+
+    setStorage: function (storage) {
+
+        var ntpOffset = hawk.utils.getNtpOffset() || 0;
+        hawk.utils.storage = storage;
+        hawk.utils.setNtpOffset(ntpOffset);
+    },
+
+    setNtpOffset: function (offset) {
+
+        hawk.utils.storage.setItem('hawk_ntp_offset', offset);
+    },
+
+    getNtpOffset: function () {
+
+        return parseInt(hawk.utils.storage.getItem('hawk_ntp_offset') || '0', 10);
+    },
+
+    now: function () {
+
+        return Date.now() + hawk.utils.getNtpOffset();
+    },
+
+    escapeHeaderAttribute: function (attribute) {
+
+        return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"');
+    },
+
+    parseContentType: function (header) {
+
+        if (!header) {
+            return '';
+        }
+
+        return header.split(';')[0].trim().toLowerCase();
+    },
+
+    parseAuthorizationHeader: function (header, keys) {
+
+        if (!header) {
+            return null;
+        }
+
+        var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/);       // Header: scheme[ something]
+        if (!headerParts) {
+            return null;
+        }
+
+        var scheme = headerParts[1];
+        if (scheme.toLowerCase() !== 'hawk') {
+            return null;
+        }
+
+        var attributesString = headerParts[2];
+        if (!attributesString) {
+            return null;
+        }
+
+        var attributes = {};
+        var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
+
+            // Check valid attribute names
+
+            if (keys.indexOf($1) === -1) {
+                return;
+            }
+
+            // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+            if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+                return;
+            }
+
+            // Check for duplicates
+
+            if (attributes.hasOwnProperty($1)) {
+                return;
+            }
+
+            attributes[$1] = $2;
+            return '';
+        });
+
+        if (verify !== '') {
+            return null;
+        }
+
+        return attributes;
+    },
+
+    randomString: function (size) {
+
+        var randomSource = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
+        var len = randomSource.length;
+
+        var result = [];
+        for (var i = 0; i < size; ++i) {
+            result[i] = randomSource[Math.floor(Math.random() * len)];
+        }
+
+        return result.join('');
+    },
+
+    parseUri: function (input) {
+
+        // Based on: parseURI 1.2.2
+        // http://blog.stevenlevithan.com/archives/parseuri
+        // (c) Steven Levithan <stevenlevithan.com>
+        // MIT License
+
+        var keys = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'hostname', 'port', 'resource', 'relative', 'pathname', 'directory', 'file', 'query', 'fragment'];
+
+        var uriRegex = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?)(?:#(.*))?)/;
+        var uriByNumber = uriRegex.exec(input);
+        var uri = {};
+
+        var i = 15;
+        while (i--) {
+            uri[keys[i]] = uriByNumber[i] || '';
+        }
+
+        if (uri.port === null ||
+            uri.port === '') {
+
+            uri.port = (uri.protocol.toLowerCase() === 'http' ? '80' : (uri.protocol.toLowerCase() === 'https' ? '443' : ''));
+        }
+
+        return uri;
+    }
+};
+
+
+// Based on: Crypto-JS v3.1.2
+// Copyright (c) 2009-2013, Jeff Mott. All rights reserved.
+// http://code.google.com/p/crypto-js/
+// http://code.google.com/p/crypto-js/wiki/License
+
+var CryptoJS=CryptoJS||function(h,r){var k={},l=k.lib={},n=function(){},f=l.Base={extend:function(a){n.prototype=this;var b=new n;a&&b.mixIn(a);b.hasOwnProperty("init")||(b.init=function(){b.$super.init.apply(this,arguments)});b.init.prototype=b;b.$super=this;return b},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},j=l.WordArray=f.extend({init:function(a,b){a=this.words=a||[];this.sigBytes=b!=r?b:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var b=this.words,d=a.words,c=this.sigBytes;a=a.sigBytes;this.clamp();if(c%4)for(var e=0;e<a;e++)b[c+e>>>2]|=(d[e>>>2]>>>24-8*(e%4)&255)<<24-8*((c+e)%4);else if(65535<d.length)for(e=0;e<a;e+=4)b[c+e>>>2]=d[e>>>2];else b.push.apply(b,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=f.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d<a;d+=4)b.push(4294967296*h.random()|0);return new j.init(b,a)}}),m=k.enc={},s=m.Hex={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c<a;c++){var e=b[c>>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c+=2)d[c>>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return new j.init(d,b/2)}},p=m.Latin1={stringify:function(a){var b=a.words;a=a.sigBytes;for(var d=[],c=0;c<a;c++)d.push(String.fromCharCode(b[c>>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c++)d[c>>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return new j.init(d,b)}},t=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},q=l.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new j.init;this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=t.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,f=c/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0);a=f*e;c=h.min(4*a,c);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(d,g);g=d.splice(0,a);b.sigBytes-=c}return new j.init(g,c)},clone:function(){var a=f.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=q.extend({cfg:f.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){q.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,d){return(new a.init(d)).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return(new u.HMAC.init(a,d)).finalize(b)}}});var u=k.algo={};return k}(Math);
+(function () { var k = CryptoJS, b = k.lib, m = b.WordArray, l = b.Hasher, d = [], b = k.algo.SHA1 = l.extend({ _doReset: function () { this._hash = new m.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) }, _doProcessBlock: function (n, p) { for (var a = this._hash.words, e = a[0], f = a[1], h = a[2], j = a[3], b = a[4], c = 0; 80 > c; c++) { if (16 > c) d[c] = n[p + c] | 0; else { var g = d[c - 3] ^ d[c - 8] ^ d[c - 14] ^ d[c - 16]; d[c] = g << 1 | g >>> 31 } g = (e << 5 | e >>> 27) + b + d[c]; g = 20 > c ? g + ((f & h | ~f & j) + 1518500249) : 40 > c ? g + ((f ^ h ^ j) + 1859775393) : 60 > c ? g + ((f & h | f & j | h & j) - 1894007588) : g + ((f ^ h ^ j) - 899497514); b = j; j = h; h = f << 30 | f >>> 2; f = e; e = g } a[0] = a[0] + e | 0; a[1] = a[1] + f | 0; a[2] = a[2] + h | 0; a[3] = a[3] + j | 0; a[4] = a[4] + b | 0 }, _doFinalize: function () { var b = this._data, d = b.words, a = 8 * this._nDataBytes, e = 8 * b.sigBytes; d[e >>> 5] |= 128 << 24 - e % 32; d[(e + 64 >>> 9 << 4) + 14] = Math.floor(a / 4294967296); d[(e + 64 >>> 9 << 4) + 15] = a; b.sigBytes = 4 * d.length; this._process(); return this._hash }, clone: function () { var b = l.clone.call(this); b._hash = this._hash.clone(); return b } }); k.SHA1 = l._createHelper(b); k.HmacSHA1 = l._createHmacHelper(b) })();
+(function (k) { for (var g = CryptoJS, h = g.lib, v = h.WordArray, j = h.Hasher, h = g.algo, s = [], t = [], u = function (q) { return 4294967296 * (q - (q | 0)) | 0 }, l = 2, b = 0; 64 > b;) { var d; a: { d = l; for (var w = k.sqrt(d), r = 2; r <= w; r++) if (!(d % r)) { d = !1; break a } d = !0 } d && (8 > b && (s[b] = u(k.pow(l, 0.5))), t[b] = u(k.pow(l, 1 / 3)), b++); l++ } var n = [], h = h.SHA256 = j.extend({ _doReset: function () { this._hash = new v.init(s.slice(0)) }, _doProcessBlock: function (q, h) { for (var a = this._hash.words, c = a[0], d = a[1], b = a[2], k = a[3], f = a[4], g = a[5], j = a[6], l = a[7], e = 0; 64 > e; e++) { if (16 > e) n[e] = q[h + e] | 0; else { var m = n[e - 15], p = n[e - 2]; n[e] = ((m << 25 | m >>> 7) ^ (m << 14 | m >>> 18) ^ m >>> 3) + n[e - 7] + ((p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10) + n[e - 16] } m = l + ((f << 26 | f >>> 6) ^ (f << 21 | f >>> 11) ^ (f << 7 | f >>> 25)) + (f & g ^ ~f & j) + t[e] + n[e]; p = ((c << 30 | c >>> 2) ^ (c << 19 | c >>> 13) ^ (c << 10 | c >>> 22)) + (c & d ^ c & b ^ d & b); l = j; j = g; g = f; f = k + m | 0; k = b; b = d; d = c; c = m + p | 0 } a[0] = a[0] + c | 0; a[1] = a[1] + d | 0; a[2] = a[2] + b | 0; a[3] = a[3] + k | 0; a[4] = a[4] + f | 0; a[5] = a[5] + g | 0; a[6] = a[6] + j | 0; a[7] = a[7] + l | 0 }, _doFinalize: function () { var d = this._data, b = d.words, a = 8 * this._nDataBytes, c = 8 * d.sigBytes; b[c >>> 5] |= 128 << 24 - c % 32; b[(c + 64 >>> 9 << 4) + 14] = k.floor(a / 4294967296); b[(c + 64 >>> 9 << 4) + 15] = a; d.sigBytes = 4 * b.length; this._process(); return this._hash }, clone: function () { var b = j.clone.call(this); b._hash = this._hash.clone(); return b } }); g.SHA256 = j._createHelper(h); g.HmacSHA256 = j._createHmacHelper(h) })(Math);
+(function(){var c=CryptoJS,k=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=new a.init;"string"==typeof b&&(b=k.parse(b));var c=a.blockSize,e=4*c;b.sigBytes>e&&(b=a.finalize(b));b.clamp();for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,j=g.words,d=0;d<c;d++)h[d]^=1549556828,j[d]^=909522486;f.sigBytes=g.sigBytes=e;this.reset()},reset:function(){var a=this._hasher;a.reset();a.update(this._iKey)},update:function(a){this._hasher.update(a);return this},finalize:function(a){var b=this._hasher;a=b.finalize(a);b.reset();return b.finalize(this._oKey.clone().concat(a))}})})();
+(function(){var h=CryptoJS,j=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();b=[];for(var a=0;a<f;a+=3)for(var d=(e[a>>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g<f;g++)b.push(c.charAt(d>>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));for(var c=[],a=0,d=0;d<e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return j.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/client.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/client.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/client.js	(revision 487)
@@ -0,0 +1,367 @@
+// Load modules
+
+var Url = require('url');
+var Hoek = require('hoek');
+var Cryptiles = require('cryptiles');
+var Crypto = require('./crypto');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Generate an Authorization header for a given request
+
+/*
+    uri: 'http://example.com/resource?a=b' or object from Url.parse()
+    method: HTTP verb (e.g. 'GET', 'POST')
+    options: {
+
+        // Required
+
+        credentials: {
+            id: 'dh37fgj492je',
+            key: 'aoijedoaijsdlaksjdl',
+            algorithm: 'sha256'                                 // 'sha1', 'sha256'
+        },
+
+        // Optional
+
+        ext: 'application-specific',                        // Application specific data sent via the ext attribute
+        timestamp: Date.now(),                              // A pre-calculated timestamp
+        nonce: '2334f34f',                                  // A pre-generated nonce
+        localtimeOffsetMsec: 400,                           // Time offset to sync with server time (ignored if timestamp provided)
+        payload: '{"some":"payload"}',                      // UTF-8 encoded string for body hash generation (ignored if hash provided)
+        contentType: 'application/json',                    // Payload content-type (ignored if hash provided)
+        hash: 'U4MKKSmiVxk37JCCrAVIjV=',                    // Pre-calculated payload hash
+        app: '24s23423f34dx',                               // Oz application id
+        dlg: '234sz34tww3sd'                                // Oz delegated-by application id
+    }
+*/
+
+exports.header = function (uri, method, options) {
+
+    var result = {
+        field: '',
+        artifacts: {}
+    };
+
+    // Validate inputs
+
+    if (!uri || (typeof uri !== 'string' && typeof uri !== 'object') ||
+        !method || typeof method !== 'string' ||
+        !options || typeof options !== 'object') {
+
+        return result;
+    }
+
+    // Application time
+
+    var timestamp = options.timestamp || Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000)
+
+    // Validate credentials
+
+    var credentials = options.credentials;
+    if (!credentials ||
+        !credentials.id ||
+        !credentials.key ||
+        !credentials.algorithm) {
+
+        // Invalid credential object
+        return result;
+    }
+
+    if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+        return result;
+    }
+
+    // Parse URI
+
+    if (typeof uri === 'string') {
+        uri = Url.parse(uri);
+    }
+
+    // Calculate signature
+
+    var artifacts = {
+        ts: timestamp,
+        nonce: options.nonce || Cryptiles.randomString(6),
+        method: method,
+        resource: uri.pathname + (uri.search || ''),                            // Maintain trailing '?'
+        host: uri.hostname,
+        port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
+        hash: options.hash,
+        ext: options.ext,
+        app: options.app,
+        dlg: options.dlg
+    };
+
+    result.artifacts = artifacts;
+
+    // Calculate payload hash
+
+    if (!artifacts.hash &&
+        options.hasOwnProperty('payload')) {
+
+        artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+    }
+
+    var mac = Crypto.calculateMac('header', credentials, artifacts);
+
+    // Construct header
+
+    var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== '';       // Other falsey values allowed
+    var header = 'Hawk id="' + credentials.id +
+                 '", ts="' + artifacts.ts +
+                 '", nonce="' + artifacts.nonce +
+                 (artifacts.hash ? '", hash="' + artifacts.hash : '') +
+                 (hasExt ? '", ext="' + Utils.escapeHeaderAttribute(artifacts.ext) : '') +
+                 '", mac="' + mac + '"';
+
+    if (artifacts.app) {
+        header += ', app="' + artifacts.app +
+                  (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"';
+    }
+
+    result.field = header;
+
+    return result;
+};
+
+
+// Validate server response
+
+/*
+    res:        node's response object
+    artifacts:  object recieved from header().artifacts
+    options: {
+        payload:    optional payload received
+        required:   specifies if a Server-Authorization header is required. Defaults to 'false'
+    }
+*/
+
+exports.authenticate = function (res, credentials, artifacts, options) {
+
+    artifacts = Hoek.clone(artifacts);
+    options = options || {};
+
+    if (res.headers['www-authenticate']) {
+
+        // Parse HTTP WWW-Authenticate header
+
+        var attributes = Utils.parseAuthorizationHeader(res.headers['www-authenticate'], ['ts', 'tsm', 'error']);
+        if (attributes instanceof Error) {
+            return false;
+        }
+
+        if (attributes.ts) {
+            var tsm = Crypto.calculateTsMac(attributes.ts, credentials);
+            if (tsm !== attributes.tsm) {
+                return false;
+            }
+        }
+    }
+
+    // Parse HTTP Server-Authorization header
+
+    if (!res.headers['server-authorization'] &&
+        !options.required) {
+
+        return true;
+    }
+
+    var attributes = Utils.parseAuthorizationHeader(res.headers['server-authorization'], ['mac', 'ext', 'hash']);
+    if (attributes instanceof Error) {
+        return false;
+    }
+
+    artifacts.ext = attributes.ext;
+    artifacts.hash = attributes.hash;
+
+    var mac = Crypto.calculateMac('response', credentials, artifacts);
+    if (mac !== attributes.mac) {
+        return false;
+    }
+
+    if (!options.hasOwnProperty('payload')) {
+        return true;
+    }
+
+    if (!attributes.hash) {
+        return false;
+    }
+
+    var calculatedHash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, res.headers['content-type']);
+    return (calculatedHash === attributes.hash);
+};
+
+
+// Generate a bewit value for a given URI
+
+/*
+ * credentials is an object with the following keys: 'id, 'key', 'algorithm'.
+ * options is an object with the following optional keys: 'ext', 'localtimeOffsetMsec'
+ */
+/*
+    uri: 'http://example.com/resource?a=b' or object from Url.parse()
+    options: {
+
+        // Required
+
+        credentials: {
+            id: 'dh37fgj492je',
+            key: 'aoijedoaijsdlaksjdl',
+            algorithm: 'sha256'                             // 'sha1', 'sha256'
+        },
+        ttlSec: 60 * 60,                                    // TTL in seconds
+
+        // Optional
+
+        ext: 'application-specific',                        // Application specific data sent via the ext attribute
+        localtimeOffsetMsec: 400                            // Time offset to sync with server time
+    };
+*/
+
+exports.getBewit = function (uri, options) {
+
+    // Validate inputs
+
+    if (!uri ||
+        (typeof uri !== 'string' && typeof uri !== 'object') ||
+        !options ||
+        typeof options !== 'object' ||
+        !options.ttlSec) {
+
+        return '';
+    }
+
+    options.ext = (options.ext === null || options.ext === undefined ? '' : options.ext);       // Zero is valid value
+
+    // Application time
+
+    var now = Utils.now() + (options.localtimeOffsetMsec || 0);
+
+    // Validate credentials
+
+    var credentials = options.credentials;
+    if (!credentials ||
+        !credentials.id ||
+        !credentials.key ||
+        !credentials.algorithm) {
+
+        return '';
+    }
+
+    if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+        return '';
+    }
+
+    // Parse URI
+
+    if (typeof uri === 'string') {
+        uri = Url.parse(uri);
+    }
+
+    // Calculate signature
+
+    var exp = Math.floor(now / 1000) + options.ttlSec;
+    var mac = Crypto.calculateMac('bewit', credentials, {
+        ts: exp,
+        nonce: '',
+        method: 'GET',
+        resource: uri.pathname + (uri.search || ''),                            // Maintain trailing '?'
+        host: uri.hostname,
+        port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
+        ext: options.ext
+    });
+
+    // Construct bewit: id\exp\mac\ext
+
+    var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + options.ext;
+    return Utils.base64urlEncode(bewit);
+};
+
+
+// Generate an authorization string for a message
+
+/*
+    host: 'example.com',
+    port: 8000,
+    message: '{"some":"payload"}',                          // UTF-8 encoded string for body hash generation
+    options: {
+
+        // Required
+
+        credentials: {
+            id: 'dh37fgj492je',
+            key: 'aoijedoaijsdlaksjdl',
+            algorithm: 'sha256'                             // 'sha1', 'sha256'
+        },
+
+        // Optional
+
+        timestamp: Date.now(),                              // A pre-calculated timestamp
+        nonce: '2334f34f',                                  // A pre-generated nonce
+        localtimeOffsetMsec: 400,                           // Time offset to sync with server time (ignored if timestamp provided)
+    }
+*/
+
+exports.message = function (host, port, message, options) {
+
+    // Validate inputs
+
+    if (!host || typeof host !== 'string' ||
+        !port || typeof port !== 'number' ||
+        message === null || message === undefined || typeof message !== 'string' ||
+        !options || typeof options !== 'object') {
+
+        return null;
+    }
+
+    // Application time
+
+    var timestamp = options.timestamp || Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000)
+
+    // Validate credentials
+
+    var credentials = options.credentials;
+    if (!credentials ||
+        !credentials.id ||
+        !credentials.key ||
+        !credentials.algorithm) {
+
+        // Invalid credential object
+        return null;
+    }
+
+    if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+        return null;
+    }
+
+    // Calculate signature
+
+    var artifacts = {
+        ts: timestamp,
+        nonce: options.nonce || Cryptiles.randomString(6),
+        host: host,
+        port: port,
+        hash: Crypto.calculatePayloadHash(message, credentials.algorithm)
+    };
+
+    // Construct authorization
+
+    var result = {
+        id: credentials.id,
+        ts: artifacts.ts,
+        nonce: artifacts.nonce,
+        hash: artifacts.hash,
+        mac: Crypto.calculateMac('message', credentials, artifacts)
+    };
+
+    return result;
+};
+
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/crypto.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/crypto.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/crypto.js	(revision 487)
@@ -0,0 +1,111 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Url = require('url');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// MAC normalization format version
+
+exports.headerVersion = '1';                        // Prevent comparison of mac values generated with different normalized string formats
+
+
+// Supported HMAC algorithms
+
+exports.algorithms = ['sha1', 'sha256'];
+
+
+// Calculate the request MAC
+
+/*
+    type: 'header',                                 // 'header', 'bewit', 'response'
+    credentials: {
+        key: 'aoijedoaijsdlaksjdl',
+        algorithm: 'sha256'                         // 'sha1', 'sha256'
+    },
+    options: {
+        method: 'GET',
+        resource: '/resource?a=1&b=2',
+        host: 'example.com',
+        port: 8080,
+        ts: 1357718381034,
+        nonce: 'd3d345f',
+        hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
+        ext: 'app-specific-data',
+        app: 'hf48hd83qwkj',                        // Application id (Oz)
+        dlg: 'd8djwekds9cj'                         // Delegated by application id (Oz), requires options.app
+    }
+*/
+
+exports.calculateMac = function (type, credentials, options) {
+
+    var normalized = exports.generateNormalizedString(type, options);
+
+    var hmac = Crypto.createHmac(credentials.algorithm, credentials.key).update(normalized);
+    var digest = hmac.digest('base64');
+    return digest;
+};
+
+
+exports.generateNormalizedString = function (type, options) {
+
+    var normalized = 'hawk.' + exports.headerVersion + '.' + type + '\n' +
+                     options.ts + '\n' +
+                     options.nonce + '\n' +
+                     (options.method || '').toUpperCase() + '\n' +
+                     (options.resource || '') + '\n' +
+                     options.host.toLowerCase() + '\n' +
+                     options.port + '\n' +
+                     (options.hash || '') + '\n';
+
+    if (options.ext) {
+        normalized += options.ext.replace('\\', '\\\\').replace('\n', '\\n');
+    }
+
+    normalized += '\n';
+
+    if (options.app) {
+        normalized += options.app + '\n' +
+                      (options.dlg || '') + '\n';
+    }
+
+    return normalized;
+};
+
+
+exports.calculatePayloadHash = function (payload, algorithm, contentType) {
+
+    var hash = exports.initializePayloadHash(algorithm, contentType);
+    hash.update(payload || '');
+    return exports.finalizePayloadHash(hash);
+};
+
+
+exports.initializePayloadHash = function (algorithm, contentType) {
+
+    var hash = Crypto.createHash(algorithm);
+    hash.update('hawk.' + exports.headerVersion + '.payload\n');
+    hash.update(Utils.parseContentType(contentType) + '\n');
+    return hash;
+};
+
+
+exports.finalizePayloadHash = function (hash) {
+
+    hash.update('\n');
+    return hash.digest('base64');
+};
+
+
+exports.calculateTsMac = function (ts, credentials) {
+
+    var hmac = Crypto.createHmac(credentials.algorithm, credentials.key);
+    hmac.update('hawk.' + exports.headerVersion + '.ts\n' + ts + '\n');
+    return hmac.digest('base64');
+};
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/index.js	(revision 487)
@@ -0,0 +1,15 @@
+// Export sub-modules
+
+exports.error = exports.Error = require('boom');
+exports.sntp = require('sntp');
+exports.server = require('./server');
+exports.client = require('./client');
+exports.crypto = require('./crypto');
+exports.utils = require('./utils');
+
+exports.uri = {
+    authenticate: exports.server.authenticateBewit,
+    getBewit: exports.client.getBewit
+};
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/server.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/server.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/server.js	(revision 487)
@@ -0,0 +1,524 @@
+// Load modules
+
+var Boom = require('boom');
+var Hoek = require('hoek');
+var Cryptiles = require('cryptiles');
+var Crypto = require('./crypto');
+var Utils = require('./utils');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Hawk authentication
+
+/*
+   req:                 node's HTTP request object or an object as follows:
+  
+                        var request = {
+                            method: 'GET',
+                            url: '/resource/4?a=1&b=2',
+                            host: 'example.com',
+                            port: 8080,
+                            authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="'
+                        };
+  
+   credentialsFunc:     required function to lookup the set of Hawk credentials based on the provided credentials id.
+                        The credentials include the MAC key, MAC algorithm, and other attributes (such as username)
+                        needed by the application. This function is the equivalent of verifying the username and
+                        password in Basic authentication.
+  
+                        var credentialsFunc = function (id, callback) {
+    
+                            // Lookup credentials in database
+                            db.lookup(id, function (err, item) {
+    
+                                if (err || !item) {
+                                    return callback(err);
+                                }
+    
+                                var credentials = {
+                                    // Required
+                                    key: item.key,
+                                    algorithm: item.algorithm,
+                                    // Application specific
+                                    user: item.user
+                                };
+    
+                                return callback(null, credentials);
+                            });
+                        };
+  
+   options: {
+
+        hostHeaderName:        optional header field name, used to override the default 'Host' header when used
+                               behind a cache of a proxy. Apache2 changes the value of the 'Host' header while preserving
+                               the original (which is what the module must verify) in the 'x-forwarded-host' header field.
+                               Only used when passed a node Http.ServerRequest object.
+  
+        nonceFunc:             optional nonce validation function. The function signature is function(nonce, ts, callback)
+                               where 'callback' must be called using the signature function(err).
+  
+        timestampSkewSec:      optional number of seconds of permitted clock skew for incoming timestamps. Defaults to 60 seconds.
+                               Provides a +/- skew which means actual allowed window is double the number of seconds.
+  
+        localtimeOffsetMsec:   optional local clock time offset express in a number of milliseconds (positive or negative).
+                               Defaults to 0.
+  
+        payload:               optional payload for validation. The client calculates the hash value and includes it via the 'hash'
+                               header attribute. The server always ensures the value provided has been included in the request
+                               MAC. When this option is provided, it validates the hash value itself. Validation is done by calculating
+                               a hash value over the entire payload (assuming it has already be normalized to the same format and
+                               encoding used by the client to calculate the hash on request). If the payload is not available at the time
+                               of authentication, the authenticatePayload() method can be used by passing it the credentials and
+                               attributes.hash returned in the authenticate callback.
+
+        host:                  optional host name override. Only used when passed a node request object.
+        port:                  optional port override. Only used when passed a node request object.
+    }
+
+    callback: function (err, credentials, artifacts) { }
+ */
+
+exports.authenticate = function (req, credentialsFunc, options, callback) {
+
+    callback = Utils.nextTick(callback);
+    
+    // Default options
+
+    options.nonceFunc = options.nonceFunc || function (nonce, ts, nonceCallback) { return nonceCallback(); };   // No validation
+    options.timestampSkewSec = options.timestampSkewSec || 60;                                                  // 60 seconds
+
+    // Application time
+
+    var now = Utils.now() + (options.localtimeOffsetMsec || 0);                 // Measure now before any other processing
+
+    // Convert node Http request object to a request configuration object
+
+    var request = Utils.parseRequest(req, options);
+    if (request instanceof Error) {
+        return callback(Boom.badRequest(request.message));
+    }
+
+    // Parse HTTP Authorization header
+
+    var attributes = Utils.parseAuthorizationHeader(request.authorization);
+    if (attributes instanceof Error) {
+        return callback(attributes);
+    }
+
+    // Construct artifacts container
+
+    var artifacts = {
+        method: request.method,
+        host: request.host,
+        port: request.port,
+        resource: request.url,
+        ts: attributes.ts,
+        nonce: attributes.nonce,
+        hash: attributes.hash,
+        ext: attributes.ext,
+        app: attributes.app,
+        dlg: attributes.dlg,
+        mac: attributes.mac,
+        id: attributes.id
+    };
+
+    // Verify required header attributes
+
+    if (!attributes.id ||
+        !attributes.ts ||
+        !attributes.nonce ||
+        !attributes.mac) {
+
+        return callback(Boom.badRequest('Missing attributes'), null, artifacts);
+    }
+
+    // Fetch Hawk credentials
+
+    credentialsFunc(attributes.id, function (err, credentials) {
+
+        if (err) {
+            return callback(err, credentials || null, artifacts);
+        }
+
+        if (!credentials) {
+            return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, artifacts);
+        }
+
+        if (!credentials.key ||
+            !credentials.algorithm) {
+
+            return callback(Boom.internal('Invalid credentials'), credentials, artifacts);
+        }
+
+        if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+            return callback(Boom.internal('Unknown algorithm'), credentials, artifacts);
+        }
+
+        // Calculate MAC
+
+        var mac = Crypto.calculateMac('header', credentials, artifacts);
+        if (!Cryptiles.fixedTimeComparison(mac, attributes.mac)) {
+            return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, artifacts);
+        }
+
+        // Check payload hash
+
+        if (options.payload !== null &&
+            options.payload !== undefined) {       // '' is valid
+
+            if (!attributes.hash) {
+                return callback(Boom.unauthorized('Missing required payload hash', 'Hawk'), credentials, artifacts);
+            }
+
+            var hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, request.contentType);
+            if (!Cryptiles.fixedTimeComparison(hash, attributes.hash)) {
+                return callback(Boom.unauthorized('Bad payload hash', 'Hawk'), credentials, artifacts);
+            }
+        }
+
+        // Check nonce
+
+        options.nonceFunc(attributes.nonce, attributes.ts, function (err) {
+
+            if (err) {
+                return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials, artifacts);
+            }
+
+            // Check timestamp staleness
+
+            if (Math.abs((attributes.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
+                var fresh = Math.floor((Utils.now() + (options.localtimeOffsetMsec || 0)) / 1000);            // Get fresh now
+                var tsm = Crypto.calculateTsMac(fresh, credentials);
+                return callback(Boom.unauthorized('Stale timestamp', 'Hawk', { ts: fresh, tsm: tsm }), credentials, artifacts);
+            }
+
+            // Successful authentication
+
+            return callback(null, credentials, artifacts);
+        });
+    });
+};
+
+
+// Authenticate payload hash - used when payload cannot be provided during authenticate()
+
+/*
+    payload:        raw request payload
+    credentials:    from authenticate callback
+    artifacts:      from authenticate callback
+    contentType:    req.headers['content-type']
+*/
+
+exports.authenticatePayload = function (payload, credentials, artifacts, contentType) {
+
+    var calculatedHash = Crypto.calculatePayloadHash(payload, credentials.algorithm, contentType);
+    return Cryptiles.fixedTimeComparison(calculatedHash, artifacts.hash);
+};
+
+
+// Generate a Server-Authorization header for a given response
+
+/*
+    credentials: {},                                        // Object received from authenticate()
+    artifacts: {}                                           // Object received from authenticate(); 'mac', 'hash', and 'ext' - ignored
+    options: {
+        ext: 'application-specific',                        // Application specific data sent via the ext attribute
+        payload: '{"some":"payload"}',                      // UTF-8 encoded string for body hash generation (ignored if hash provided)
+        contentType: 'application/json',                    // Payload content-type (ignored if hash provided)
+        hash: 'U4MKKSmiVxk37JCCrAVIjV='                     // Pre-calculated payload hash
+    }
+*/
+
+exports.header = function (credentials, artifacts, options) {
+
+    // Prepare inputs
+
+    options = options || {};
+
+    if (!artifacts ||
+        typeof artifacts !== 'object' ||
+        typeof options !== 'object') {
+
+        return '';
+    }
+
+    artifacts = Hoek.clone(artifacts);
+    delete artifacts.mac;
+    artifacts.hash = options.hash;
+    artifacts.ext = options.ext;
+
+    // Validate credentials
+
+    if (!credentials ||
+        !credentials.key ||
+        !credentials.algorithm) {
+
+        // Invalid credential object
+        return '';
+    }
+
+    if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+        return '';
+    }
+
+    // Calculate payload hash
+
+    if (!artifacts.hash &&
+        options.hasOwnProperty('payload')) {
+
+        artifacts.hash = Crypto.calculatePayloadHash(options.payload, credentials.algorithm, options.contentType);
+    }
+
+    var mac = Crypto.calculateMac('response', credentials, artifacts);
+
+    // Construct header
+
+    var header = 'Hawk mac="' + mac + '"' +
+                 (artifacts.hash ? ', hash="' + artifacts.hash + '"' : '');
+
+    if (artifacts.ext !== null &&
+        artifacts.ext !== undefined &&
+        artifacts.ext !== '') {                       // Other falsey values allowed
+
+        header += ', ext="' + Utils.escapeHeaderAttribute(artifacts.ext) + '"';
+    }
+
+    return header;
+};
+
+
+/*
+ * Arguments and options are the same as authenticate() with the exception that the only supported options are:
+ * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port'
+ */
+
+exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
+
+    callback = Utils.nextTick(callback);
+
+    // Application time
+
+    var now = Utils.now() + (options.localtimeOffsetMsec || 0);
+
+    // Convert node Http request object to a request configuration object
+
+    var request = Utils.parseRequest(req, options);
+    if (request instanceof Error) {
+        return callback(Boom.badRequest(request.message));
+    }
+
+    // Extract bewit
+
+    //                                 1     2             3           4     
+    var resource = request.url.match(/^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/);
+    if (!resource) {
+        return callback(Boom.unauthorized(null, 'Hawk'));
+    }
+
+    // Bewit not empty
+
+    if (!resource[3]) {
+        return callback(Boom.unauthorized('Empty bewit', 'Hawk'));
+    }
+
+    // Verify method is GET
+
+    if (request.method !== 'GET' &&
+        request.method !== 'HEAD') {
+
+        return callback(Boom.unauthorized('Invalid method', 'Hawk'));
+    }
+
+    // No other authentication
+
+    if (request.authorization) {
+        return callback(Boom.badRequest('Multiple authentications', 'Hawk'));
+    }
+
+    // Parse bewit
+
+    var bewitString = Utils.base64urlDecode(resource[3]);
+    if (bewitString instanceof Error) {
+        return callback(Boom.badRequest('Invalid bewit encoding'));
+    }
+
+    // Bewit format: id\exp\mac\ext ('\' is used because it is a reserved header attribute character)
+
+    var bewitParts = bewitString.split('\\');
+    if (!bewitParts ||
+        bewitParts.length !== 4) {
+
+        return callback(Boom.badRequest('Invalid bewit structure'));
+    }
+
+    var bewit = {
+        id: bewitParts[0],
+        exp: parseInt(bewitParts[1], 10),
+        mac: bewitParts[2],
+        ext: bewitParts[3] || ''
+    };
+
+    if (!bewit.id ||
+        !bewit.exp ||
+        !bewit.mac) {
+
+        return callback(Boom.badRequest('Missing bewit attributes'));
+    }
+
+    // Construct URL without bewit
+
+    var url = resource[1];
+    if (resource[4]) {
+        url += resource[2] + resource[4];
+    }
+
+    // Check expiration
+
+    if (bewit.exp * 1000 <= now) {
+        return callback(Boom.unauthorized('Access expired', 'Hawk'), null, bewit);
+    }
+
+    // Fetch Hawk credentials
+
+    credentialsFunc(bewit.id, function (err, credentials) {
+
+        if (err) {
+            return callback(err, credentials || null, bewit.ext);
+        }
+
+        if (!credentials) {
+            return callback(Boom.unauthorized('Unknown credentials', 'Hawk'), null, bewit);
+        }
+
+        if (!credentials.key ||
+            !credentials.algorithm) {
+
+            return callback(Boom.internal('Invalid credentials'), credentials, bewit);
+        }
+
+        if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+            return callback(Boom.internal('Unknown algorithm'), credentials, bewit);
+        }
+
+        // Calculate MAC
+
+        var mac = Crypto.calculateMac('bewit', credentials, {
+            ts: bewit.exp,
+            nonce: '',
+            method: 'GET',
+            resource: url,
+            host: request.host,
+            port: request.port,
+            ext: bewit.ext
+        });
+
+        if (!Cryptiles.fixedTimeComparison(mac, bewit.mac)) {
+            return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials, bewit);
+        }
+
+        // Successful authentication
+
+        return callback(null, credentials, bewit);
+    });
+};
+
+
+/*
+ *  options are the same as authenticate() with the exception that the only supported options are:
+ * 'nonceFunc', 'timestampSkewSec', 'localtimeOffsetMsec'
+ */
+
+exports.authenticateMessage = function (host, port, message, authorization, credentialsFunc, options, callback) {
+
+    callback = Utils.nextTick(callback);
+    
+    // Default options
+
+    options.nonceFunc = options.nonceFunc || function (nonce, ts, nonceCallback) { return nonceCallback(); };   // No validation
+    options.timestampSkewSec = options.timestampSkewSec || 60;                                                  // 60 seconds
+
+    // Application time
+
+    var now = Utils.now() + (options.localtimeOffsetMsec || 0);                 // Measure now before any other processing
+
+    // Validate authorization
+    
+    if (!authorization.id ||
+        !authorization.ts ||
+        !authorization.nonce ||
+        !authorization.hash ||
+        !authorization.mac) {
+        
+            return callback(Boom.badRequest('Invalid authorization'))
+    }
+
+    // Fetch Hawk credentials
+
+    credentialsFunc(authorization.id, function (err, credentials) {
+
+        if (err) {
+            return callback(err, credentials || null);
+        }
+
+        if (!credentials) {
+            return callback(Boom.unauthorized('Unknown credentials', 'Hawk'));
+        }
+
+        if (!credentials.key ||
+            !credentials.algorithm) {
+
+            return callback(Boom.internal('Invalid credentials'), credentials);
+        }
+
+        if (Crypto.algorithms.indexOf(credentials.algorithm) === -1) {
+            return callback(Boom.internal('Unknown algorithm'), credentials);
+        }
+
+        // Construct artifacts container
+
+        var artifacts = {
+            ts: authorization.ts,
+            nonce: authorization.nonce,
+            host: host,
+            port: port,
+            hash: authorization.hash
+        };
+
+        // Calculate MAC
+
+        var mac = Crypto.calculateMac('message', credentials, artifacts);
+        if (!Cryptiles.fixedTimeComparison(mac, authorization.mac)) {
+            return callback(Boom.unauthorized('Bad mac', 'Hawk'), credentials);
+        }
+
+        // Check payload hash
+
+        var hash = Crypto.calculatePayloadHash(message, credentials.algorithm);
+        if (!Cryptiles.fixedTimeComparison(hash, authorization.hash)) {
+            return callback(Boom.unauthorized('Bad message hash', 'Hawk'), credentials);
+        }
+
+        // Check nonce
+
+        options.nonceFunc(authorization.nonce, authorization.ts, function (err) {
+
+            if (err) {
+                return callback(Boom.unauthorized('Invalid nonce', 'Hawk'), credentials);
+            }
+
+            // Check timestamp staleness
+
+            if (Math.abs((authorization.ts * 1000) - now) > (options.timestampSkewSec * 1000)) {
+                return callback(Boom.unauthorized('Stale timestamp'), credentials);
+            }
+
+            // Successful authentication
+
+            return callback(null, credentials);
+        });
+    });
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/utils.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/utils.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/lib/utils.js	(revision 487)
@@ -0,0 +1,183 @@
+// Load modules
+
+var Hoek = require('hoek');
+var Sntp = require('sntp');
+var Boom = require('boom');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Import Hoek Utilities
+
+internals.import = function () {
+
+    for (var i in Hoek) {
+        if (Hoek.hasOwnProperty(i)) {
+            exports[i] = Hoek[i];
+        }
+    }
+};
+
+internals.import();
+
+
+// Hawk version
+
+exports.version = function () {
+
+    return exports.loadPackage(__dirname + '/..').version;
+};
+
+
+// Extract host and port from request
+
+exports.parseHost = function (req, hostHeaderName) {
+
+    hostHeaderName = (hostHeaderName ? hostHeaderName.toLowerCase() : 'host');
+    var hostHeader = req.headers[hostHeaderName];
+    if (!hostHeader) {
+        return null;
+    }
+
+    var hostHeaderRegex;
+    if (hostHeader[0] === '[') {
+        hostHeaderRegex = /^(?:(?:\r\n)?\s)*(\[[^\]]+\])(?::(\d+))?(?:(?:\r\n)?\s)*$/;      // IPv6
+    }
+    else {
+        hostHeaderRegex = /^(?:(?:\r\n)?\s)*([^:]+)(?::(\d+))?(?:(?:\r\n)?\s)*$/;           // IPv4, hostname
+    }
+    
+    var hostParts = hostHeader.match(hostHeaderRegex);
+
+    if (!hostParts ||
+        hostParts.length !== 3 ||
+        !hostParts[1]) {
+
+        return null;
+    }
+
+    return {
+        name: hostParts[1],
+        port: (hostParts[2] ? hostParts[2] : (req.connection && req.connection.encrypted ? 443 : 80))
+    };
+};
+
+
+// Parse Content-Type header content
+
+exports.parseContentType = function (header) {
+
+    if (!header) {
+        return '';
+    }
+
+    return header.split(';')[0].trim().toLowerCase();
+};
+
+
+// Convert node's  to request configuration object
+
+exports.parseRequest = function (req, options) {
+
+    if (!req.headers) {
+        return req;
+    }
+    
+    // Obtain host and port information
+
+    if (!options.host || !options.port) {
+        var host = exports.parseHost(req, options.hostHeaderName);
+        if (!host) {
+            return new Error('Invalid Host header');
+        }
+    }
+
+    var request = {
+        method: req.method,
+        url: req.url,
+        host: options.host || host.name,
+        port: options.port || host.port,
+        authorization: req.headers.authorization,
+        contentType: req.headers['content-type'] || ''
+    };
+
+    return request;
+};
+
+
+exports.now = function () {
+
+    return Sntp.now();
+};
+
+
+// Parse Hawk HTTP Authorization header
+
+exports.parseAuthorizationHeader = function (header, keys) {
+
+    keys = keys || ['id', 'ts', 'nonce', 'hash', 'ext', 'mac', 'app', 'dlg'];
+
+    if (!header) {
+        return Boom.unauthorized(null, 'Hawk');
+    }
+
+    var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/);       // Header: scheme[ something]
+    if (!headerParts) {
+        return Boom.badRequest('Invalid header syntax');
+    }
+
+    var scheme = headerParts[1];
+    if (scheme.toLowerCase() !== 'hawk') {
+        return Boom.unauthorized(null, 'Hawk');
+    }
+
+    var attributesString = headerParts[2];
+    if (!attributesString) {
+        return Boom.badRequest('Invalid header syntax');
+    }
+
+    var attributes = {};
+    var errorMessage = '';
+    var verify = attributesString.replace(/(\w+)="([^"\\]*)"\s*(?:,\s*|$)/g, function ($0, $1, $2) {
+
+        // Check valid attribute names
+
+        if (keys.indexOf($1) === -1) {
+            errorMessage = 'Unknown attribute: ' + $1;
+            return;
+        }
+
+        // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+        if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+            errorMessage = 'Bad attribute value: ' + $1;
+            return;
+        }
+
+        // Check for duplicates
+
+        if (attributes.hasOwnProperty($1)) {
+            errorMessage = 'Duplicate attribute: ' + $1;
+            return;
+        }
+
+        attributes[$1] = $2;
+        return '';
+    });
+
+    if (verify !== '') {
+        return Boom.badRequest(errorMessage || 'Bad header format');
+    }
+
+    return attributes;
+};
+
+
+exports.unauthorized = function (message) {
+
+    return Boom.unauthorized(message, 'Hawk');
+};
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore	(revision 487)
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml	(revision 487)
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+  - 0.10
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/LICENSE	(revision 487)
@@ -0,0 +1,24 @@
+Copyright (c) 2012-2013, Walmart.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Walmart nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL WALMART BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/Makefile	(revision 487)
@@ -0,0 +1,11 @@
+test:
+	@node node_modules/lab/bin/lab
+test-cov: 
+	@node node_modules/lab/bin/lab -r threshold -t 100
+test-cov-html:
+	@node node_modules/lab/bin/lab -r html -o coverage.html
+complexity:
+	@node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib
+
+.PHONY: test test-cov test-cov-html complexity
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/README.md	(revision 487)
@@ -0,0 +1,6 @@
+<a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a>
+![boom Logo](https://raw.github.com/spumko/boom/master/images/boom.png)
+
+HTTP-friendly error objects
+
+[![Build Status](https://secure.travis-ci.org/spumko/boom.png)](http://travis-ci.org/spumko/boom)
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/index.js	(revision 487)
@@ -0,0 +1,1 @@
+module.exports = require('./lib');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js	(revision 487)
@@ -0,0 +1,207 @@
+// Load modules
+
+var Http = require('http');
+var NodeUtil = require('util');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports = module.exports = internals.Boom = function (/* (new Error) or (code, message) */) {
+
+    var self = this;
+
+    Hoek.assert(this.constructor === internals.Boom, 'Error must be instantiated using new');
+
+    Error.call(this);
+    this.isBoom = true;
+
+    this.response = {
+        code: 0,
+        payload: {},
+        headers: {}
+        // type: 'content-type'
+    };
+
+    if (arguments[0] instanceof Error) {
+
+        // Error
+
+        var error = arguments[0];
+
+        this.data = error;
+        this.response.code = error.code || 500;
+        if (error.message) {
+            this.message = error.message;
+        }
+    }
+    else {
+
+        // code, message
+
+        var code = arguments[0];
+        var message = arguments[1];
+
+        Hoek.assert(!isNaN(parseFloat(code)) && isFinite(code) && code >= 400, 'First argument must be a number (400+)');
+
+        this.response.code = code;
+        if (message) {
+            this.message = message;
+        }
+    }
+
+    // Response format
+
+    this.reformat();
+
+    return this;
+};
+
+NodeUtil.inherits(internals.Boom, Error);
+
+
+internals.Boom.prototype.reformat = function () {
+
+    this.response.payload.code = this.response.code;
+    this.response.payload.error = Http.STATUS_CODES[this.response.code] || 'Unknown';
+    if (this.message) {
+        this.response.payload.message = Hoek.escapeHtml(this.message);         // Prevent XSS from error message
+    }
+};
+
+
+// Utilities
+
+internals.Boom.badRequest = function (message) {
+
+    return new internals.Boom(400, message);
+};
+
+
+internals.Boom.unauthorized = function (message, scheme, attributes) {          // Or function (message, wwwAuthenticate[])
+
+    var err = new internals.Boom(401, message);
+
+    if (!scheme) {
+        return err;
+    }
+
+    var wwwAuthenticate = '';
+
+    if (typeof scheme === 'string') {
+
+        // function (message, scheme, attributes)
+
+        wwwAuthenticate = scheme;
+        if (attributes) {
+            var names = Object.keys(attributes);
+            for (var i = 0, il = names.length; i < il; ++i) {
+                if (i) {
+                    wwwAuthenticate += ',';
+                }
+
+                var value = attributes[names[i]];
+                if (value === null ||
+                    value === undefined) {              // Value can be zero
+
+                    value = '';
+                }
+                wwwAuthenticate += ' ' + names[i] + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"';
+            }
+        }
+
+        if (message) {
+            if (attributes) {
+                wwwAuthenticate += ',';
+            }
+            wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"';
+        }
+        else {
+            err.isMissing = true;
+        }
+    }
+    else {
+
+        // function (message, wwwAuthenticate[])
+
+        var wwwArray = scheme;
+        for (var i = 0, il = wwwArray.length; i < il; ++i) {
+            if (i) {
+                wwwAuthenticate += ', ';
+            }
+
+            wwwAuthenticate += wwwArray[i];
+        }
+    }
+
+    err.response.headers['WWW-Authenticate'] = wwwAuthenticate;
+
+    return err;
+};
+
+
+internals.Boom.clientTimeout = function (message) {
+
+    return new internals.Boom(408, message);
+};
+
+
+internals.Boom.serverTimeout = function (message) {
+
+    return new internals.Boom(503, message);
+};
+
+
+internals.Boom.forbidden = function (message) {
+
+    return new internals.Boom(403, message);
+};
+
+
+internals.Boom.notFound = function (message) {
+
+    return new internals.Boom(404, message);
+};
+
+
+internals.Boom.internal = function (message, data) {
+
+    var err = new internals.Boom(500, message);
+
+    if (data && data.stack) {
+        err.trace = data.stack.split('\n');
+        err.outterTrace = Hoek.displayStack(1);
+    }
+    else {
+        err.trace = Hoek.displayStack(1);
+    }
+
+    err.data = data;
+    err.response.payload.message = 'An internal server error occurred';                     // Hide actual error from user
+
+    return err;
+};
+
+
+internals.Boom.passThrough = function (code, payload, contentType, headers) {
+
+    var err = new internals.Boom(500, 'Pass-through');                                      // 500 code is only used to initialize
+
+    err.data = {
+        code: code,
+        payload: payload,
+        type: contentType
+    };
+
+    err.response.code = code;
+    err.response.type = contentType;
+    err.response.headers = headers;
+    err.response.payload = payload;
+
+    return err;
+};
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/package.json	(revision 487)
@@ -0,0 +1,47 @@
+{
+  "name": "boom",
+  "description": "HTTP-friendly error objects",
+  "version": "0.4.2",
+  "author": {
+    "name": "Eran Hammer",
+    "email": "eran@hueniverse.com",
+    "url": "http://hueniverse.com"
+  },
+  "contributors": [],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/spumko/boom"
+  },
+  "main": "index",
+  "keywords": [
+    "error",
+    "http"
+  ],
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "dependencies": {
+    "hoek": "0.9.x"
+  },
+  "devDependencies": {
+    "lab": "0.1.x",
+    "complexity-report": "0.x.x"
+  },
+  "scripts": {
+    "test": "make test-cov"
+  },
+  "licenses": [
+    {
+      "type": "BSD",
+      "url": "http://github.com/spumko/boom/raw/master/LICENSE"
+    }
+  ],
+  "readme": "<a href=\"https://github.com/spumko\"><img src=\"https://raw.github.com/spumko/spumko/master/images/from.png\" align=\"right\" /></a>\n![boom Logo](https://raw.github.com/spumko/boom/master/images/boom.png)\n\nHTTP-friendly error objects\n\n[![Build Status](https://secure.travis-ci.org/spumko/boom.png)](http://travis-ci.org/spumko/boom)\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/spumko/boom/issues"
+  },
+  "homepage": "https://github.com/spumko/boom",
+  "_id": "boom@0.4.2",
+  "_from": "boom@0.4.x"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js	(revision 487)
@@ -0,0 +1,245 @@
+// Load modules
+
+var Lab = require('lab');
+var Boom = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Boom', function () {
+
+    it('returns an error with info when constructed using another error', function (done) {
+
+        var error = new Error('ka-boom');
+        error.xyz = 123;
+        var err = new Boom(error);
+        expect(err.data.xyz).to.equal(123);
+        expect(err.message).to.equal('ka-boom');
+        expect(err.response).to.deep.equal({
+            code: 500,
+            payload: {
+                code: 500,
+                error: 'Internal Server Error',
+                message: 'ka-boom'
+            },
+            headers: {}
+        });
+        done();
+    });
+
+    describe('#isBoom', function () {
+
+        it('returns true for Boom object', function (done) {
+
+            expect(Boom.badRequest().isBoom).to.equal(true);
+            done();
+        });
+
+        it('returns false for Error object', function (done) {
+
+            expect(new Error().isBoom).to.not.exist;
+            done();
+        });
+    });
+
+    describe('#badRequest', function () {
+
+        it('returns a 400 error code', function (done) {
+
+            expect(Boom.badRequest().response.code).to.equal(400);
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            expect(Boom.badRequest('my message').message).to.equal('my message');
+            done();
+        });
+    });
+
+    describe('#unauthorized', function () {
+
+        it('returns a 401 error code', function (done) {
+
+            var err = Boom.unauthorized();
+            expect(err.response.code).to.equal(401);
+            expect(err.response.headers).to.deep.equal({});
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            expect(Boom.unauthorized('my message').message).to.equal('my message');
+            done();
+        });
+
+        it('returns a WWW-Authenticate header when passed a scheme', function (done) {
+
+            var err = Boom.unauthorized('boom', 'Test');
+            expect(err.response.code).to.equal(401);
+            expect(err.response.headers['WWW-Authenticate']).to.equal('Test error="boom"');
+            done();
+        });
+
+        it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) {
+
+            var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 });
+            expect(err.response.code).to.equal(401);
+            expect(err.response.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"');
+            done();
+        });
+
+        it('sets the isMissing flag when error message is empty', function (done) {
+
+            var err = Boom.unauthorized('', 'Basic');
+            expect(err.isMissing).to.equal(true);
+            done();
+        });
+
+        it('does not set the isMissing flag when error message is not empty', function (done) {
+
+            var err = Boom.unauthorized('message', 'Basic');
+            expect(err.isMissing).to.equal(undefined);
+            done();
+        });
+
+        it('sets a WWW-Authenticate when passed as an array', function (done) {
+
+            var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']);
+            expect(err.response.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"');
+            done();
+        });
+    });
+
+    describe('#clientTimeout', function () {
+
+        it('returns a 408 error code', function (done) {
+
+            expect(Boom.clientTimeout().response.code).to.equal(408);
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            expect(Boom.clientTimeout('my message').message).to.equal('my message');
+            done();
+        });
+    });
+
+    describe('#serverTimeout', function () {
+
+        it('returns a 503 error code', function (done) {
+
+            expect(Boom.serverTimeout().response.code).to.equal(503);
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            expect(Boom.serverTimeout('my message').message).to.equal('my message');
+            done();
+        });
+    });
+
+    describe('#forbidden', function () {
+
+        it('returns a 403 error code', function (done) {
+
+            expect(Boom.forbidden().response.code).to.equal(403);
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            expect(Boom.forbidden('my message').message).to.equal('my message');
+            done();
+        });
+    });
+
+    describe('#notFound', function () {
+
+        it('returns a 404 error code', function (done) {
+
+            expect(Boom.notFound().response.code).to.equal(404);
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            expect(Boom.notFound('my message').message).to.equal('my message');
+            done();
+        });
+    });
+
+    describe('#internal', function () {
+
+        it('returns a 500 error code', function (done) {
+
+            expect(Boom.internal().response.code).to.equal(500);
+            done();
+        });
+
+        it('sets the message with the passed in message', function (done) {
+
+            var err = Boom.internal('my message');
+            expect(err.message).to.equal('my message');
+            expect(err.response.payload.message).to.equal('An internal server error occurred');
+            done();
+        });
+
+        it('passes data on the callback if its passed in', function (done) {
+
+            expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data');
+            done();
+        });
+
+        it('uses passed in stack if its available', function (done) {
+
+            var error = new Error();
+            error.stack = 'my stack line\nmy second stack line';
+            expect(Boom.internal('my message', error).trace[0]).to.equal('my stack line');
+            done();
+        });
+    });
+
+    describe('#passThrough', function () {
+
+        it('returns a pass-through error', function (done) {
+
+            var err = Boom.passThrough(499, { a: 1 }, 'application/text', { 'X-Test': 'Boom' });
+            expect(err.response.code).to.equal(499);
+            expect(err.message).to.equal('Pass-through');
+            expect(err.response).to.deep.equal({
+                code: 499,
+                payload: { a: 1 },
+                headers: { 'X-Test': 'Boom' },
+                type: 'application/text'
+            });
+            done();
+        });
+    });
+
+    describe('#reformat', function () {
+
+        it('encodes any HTML markup in the response payload', function (done) {
+
+            var boom = new Boom(new Error('<script>alert(1)</script>'));
+            expect(boom.response.payload.message).to.not.contain('<script>');
+            done();
+        });
+    });
+});
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore	(revision 487)
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml	(revision 487)
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+  - 0.10
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/LICENSE	(revision 487)
@@ -0,0 +1,24 @@
+Copyright (c) 2012-2013, Eran Hammer.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Eran Hammer nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile	(revision 487)
@@ -0,0 +1,11 @@
+test:
+	@./node_modules/.bin/lab
+test-cov: 
+	@./node_modules/.bin/lab -r threshold -t 100
+test-cov-html:
+	@./node_modules/.bin/lab -r html -o coverage.html
+complexity:
+	@./node_modules/.bin/cr -o complexity.md -f markdown lib
+
+.PHONY: test test-cov test-cov-html complexity
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md	(revision 487)
@@ -0,0 +1,6 @@
+cryptiles
+=========
+
+General purpose crypto utilities
+
+[![Build Status](https://secure.travis-ci.org/hueniverse/cryptiles.png)](http://travis-ci.org/hueniverse/cryptiles)
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js	(revision 487)
@@ -0,0 +1,1 @@
+module.exports = require('./lib');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js	(revision 487)
@@ -0,0 +1,68 @@
+// Load modules
+
+var Crypto = require('crypto');
+var Boom = require('boom');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Generate a cryptographically strong pseudo-random data
+
+exports.randomString = function (size) {
+
+    var buffer = exports.randomBits((size + 1) * 6);
+    if (buffer instanceof Error) {
+        return buffer;
+    }
+
+    var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+    return string.slice(0, size);
+};
+
+
+exports.randomBits = function (bits) {
+
+    if (!bits ||
+        bits < 0) {
+
+        return Boom.internal('Invalid random bits count');
+    }
+
+    var bytes = Math.ceil(bits / 8);
+    try {
+        return Crypto.randomBytes(bytes);
+    }
+    catch (err) {
+        return Boom.internal('Failed generating random bits: ' + err.message);
+    }
+};
+
+
+// Compare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match)
+
+exports.fixedTimeComparison = function (a, b) {
+
+    if (typeof a !== 'string' ||
+        typeof b !== 'string') {
+
+        return false;
+    }
+
+    var mismatch = (a.length === b.length ? 0 : 1);
+    if (mismatch) {
+        b = a;
+    }
+
+    for (var i = 0, il = a.length; i < il; ++i) {
+        var ac = a.charCodeAt(i);
+        var bc = b.charCodeAt(i);
+        mismatch += (ac === bc ? 0 : 1);
+    }
+
+    return (mismatch === 0);
+};
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json	(revision 487)
@@ -0,0 +1,48 @@
+{
+  "name": "cryptiles",
+  "description": "General purpose crypto utilities",
+  "version": "0.2.2",
+  "author": {
+    "name": "Eran Hammer",
+    "email": "eran@hueniverse.com",
+    "url": "http://hueniverse.com"
+  },
+  "contributors": [],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/hueniverse/cryptiles"
+  },
+  "main": "index",
+  "keywords": [
+    "cryptography",
+    "security",
+    "utilites"
+  ],
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "dependencies": {
+    "boom": "0.4.x"
+  },
+  "devDependencies": {
+    "lab": "0.1.x",
+    "complexity-report": "0.x.x"
+  },
+  "scripts": {
+    "test": "make test-cov"
+  },
+  "licenses": [
+    {
+      "type": "BSD",
+      "url": "http://github.com/hueniverse/cryptiles/raw/master/LICENSE"
+    }
+  ],
+  "readme": "cryptiles\n=========\n\nGeneral purpose crypto utilities\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/cryptiles.png)](http://travis-ci.org/hueniverse/cryptiles)\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/hueniverse/cryptiles/issues"
+  },
+  "homepage": "https://github.com/hueniverse/cryptiles",
+  "_id": "cryptiles@0.2.2",
+  "_from": "cryptiles@0.2.x"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js	(revision 487)
@@ -0,0 +1,101 @@
+// Load modules
+
+var Lab = require('lab');
+var Cryptiles = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Cryptiles', function () {
+
+    describe('#randomString', function () {
+
+        it('should generate the right length string', function (done) {
+
+            for (var i = 1; i <= 1000; ++i) {
+                expect(Cryptiles.randomString(i).length).to.equal(i);
+            }
+
+            done();
+        });
+
+        it('returns an error on invalid bits size', function (done) {
+
+            expect(Cryptiles.randomString(99999999999999999999).message).to.equal('Failed generating random bits: Argument #1 must be number > 0');
+            done();
+        });
+    });
+
+    describe('#randomBits', function () {
+
+        it('returns an error on invalid input', function (done) {
+
+            expect(Cryptiles.randomBits(0).message).to.equal('Invalid random bits count');
+            done();
+        });
+    });
+
+    describe('#fixedTimeComparison', function () {
+
+        var a = Cryptiles.randomString(50000);
+        var b = Cryptiles.randomString(150000);
+
+        it('should take the same amount of time comparing different string sizes', function (done) {
+
+            var now = Date.now();
+            Cryptiles.fixedTimeComparison(b, a);
+            var t1 = Date.now() - now;
+
+            now = Date.now();
+            Cryptiles.fixedTimeComparison(b, b);
+            var t2 = Date.now() - now;
+
+            expect(t2 - t1).to.be.within(-20, 20);
+            done();
+        });
+
+        it('should return true for equal strings', function (done) {
+
+            expect(Cryptiles.fixedTimeComparison(a, a)).to.equal(true);
+            done();
+        });
+
+        it('should return false for different strings (size, a < b)', function (done) {
+
+            expect(Cryptiles.fixedTimeComparison(a, a + 'x')).to.equal(false);
+            done();
+        });
+
+        it('should return false for different strings (size, a > b)', function (done) {
+
+            expect(Cryptiles.fixedTimeComparison(a + 'x', a)).to.equal(false);
+            done();
+        });
+
+        it('should return false for different strings (size, a = b)', function (done) {
+
+            expect(Cryptiles.fixedTimeComparison(a + 'x', a + 'y')).to.equal(false);
+            done();
+        });
+
+        it('should return false when not a string', function (done) {
+
+            expect(Cryptiles.fixedTimeComparison('x', null)).to.equal(false);
+            done();
+        });
+    });
+});
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/.npmignore	(revision 487)
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+complexity.md
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml	(revision 487)
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+  - 0.10
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE	(revision 487)
@@ -0,0 +1,33 @@
+Copyright (c) 2011-2013, Walmart.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Walmart nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL WALMART BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+                                  *   *   *
+
+
+Portions of this project were initially based on Postmile, Copyright (c) 2011, Yahoo Inc.
+Postmile is published at https://github.com/yahoo/postmile and its licensing terms are
+published at https://github.com/yahoo/postmile/blob/master/LICENSE.
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile	(revision 487)
@@ -0,0 +1,10 @@
+test:
+	@node node_modules/lab/bin/lab
+test-cov: 
+	@node node_modules/lab/bin/lab -r threshold -t 100
+test-cov-html:
+	@node node_modules/lab/bin/lab -r html -o coverage.html
+complexity:
+	@node node_modules/complexity-report/src/cli.js -o complexity.md -f markdown lib
+
+.PHONY: test test-cov test-cov-html complexity
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/README.md	(revision 487)
@@ -0,0 +1,436 @@
+<a href="https://github.com/spumko"><img src="https://raw.github.com/spumko/spumko/master/images/from.png" align="right" /></a>
+![hoek Logo](https://raw.github.com/spumko/hoek/master/images/hoek.png)
+
+General purpose node utilities
+
+[![Build Status](https://secure.travis-ci.org/spumko/hoek.png)](http://travis-ci.org/spumko/hoek)
+
+# Table of Contents
+
+* [Introduction](#introduction "Introduction")
+* [Object](#object "Object")
+  * [clone](#cloneobj "clone")
+  * [merge](#mergetarget-source-isnulloverride-ismergearrays "merge")
+  * [applyToDefaults](#applytodefaultsdefaults-options "applyToDefaults")
+  * [unique](#uniquearray-key "unique")
+  * [mapToObject](#maptoobjectarray-key "mapToObject")
+  * [intersect](#intersectarray1-array2 "intersect")
+  * [matchKeys](#matchkeysobj-keys "matchKeys")
+  * [flatten](#flattenarray-target "flatten")
+  * [removeKeys](#removekeysobject-keys "removeKeys")
+  * [reach](#reachobj-chain "reach")
+  * [inheritAsync](#inheritasyncself-obj-keys "inheritAsync")
+  * [rename](#renameobj-from-to "rename")
+* [Timer](#timer "Timer")
+* [Binary Encoding/Decoding](#binary "Binary Encoding/Decoding")
+  * [base64urlEncode](#binary64urlEncodevalue "binary64urlEncode")
+  * [base64urlDecode](#binary64urlDecodevalue "binary64urlDecode")
+* [Escaping Characters](#escaped "Escaping Characters")
+  * [escapeHtml](#escapeHtmlstring "escapeHtml")
+  * [escapeHeaderAttribute](#escapeHeaderAttributeattribute "escapeHeaderAttribute")
+  * [escapeRegex](#escapeRegexstring "escapeRegex")
+* [Errors](#errors "Errors")
+  * [assert](#assertmessage "assert")
+  * [abort](#abortmessage "abort")
+  * [displayStack](#displayStackslice "displayStack")
+  * [callStack](#callStackslice "callStack")
+  * [toss](#tosscondition "toss")
+* [Load files](#load-files "Load Files")
+  * [loadPackage](#loadPackagedir "loadpackage")
+  * [loadDirModules](#loadDirModulespath-excludefiles-target "loaddirmodules")
+
+
+
+# Introduction
+
+The *Hoek* general purpose node utilities library is used to aid in a variety of manners. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more. 
+
+For example, to use Hoek to set configuration with default options:
+```javascript
+var Hoek = require('hoek');
+
+var default = {url : "www.github.com", port : "8000", debug : true}
+
+var config = Hoek.applyToDefaults(default, {port : "3000", admin : true});
+
+// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }
+```
+
+Under each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the var Hoek = require('hoek') is omitted for brevity.
+
+## Object
+
+Hoek provides several helpful methods for objects and arrays.
+
+### clone(obj)
+
+This method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects). 
+
+```javascript
+
+var nestedObj = {
+        w: /^something$/ig,
+        x: {
+            a: [1, 2, 3],
+            b: 123456,
+            c: new Date()
+        },
+        y: 'y',
+        z: new Date()
+    };
+
+var copy = Hoek.clone(nestedObj);
+
+copy.x.b = 100;
+
+console.log(copy.y)        // results in 'y'
+console.log(nestedObj.x.b) // results in 123456
+console.log(copy.x.b)      // results in 100
+```
+
+### merge(target, source, isNullOverride, isMergeArrays)
+isNullOverride, isMergeArrays default to true
+
+Merge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied
+
+
+```javascript
+
+var target = {a: 1, b : 2}
+var source = {a: 0, c: 5}
+var source2 = {a: null, c: 5}
+
+var targetArray = [1, 2, 3];
+var sourceArray = [4, 5];
+
+var newTarget = Hoek.merge(target, source);     // results in {a: 0, b: 2, c: 5}
+newTarget = Hoek.merge(target, source2);        // results in {a: null, b: 2, c: 5}
+newTarget = Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}
+
+newTarget = Hoek.merge(targetArray, sourceArray)              // results in [1, 2, 3, 4, 5]
+newTarget = Hoek.merge(targetArray, sourceArray, true, false) // results in [4, 5]
+
+
+
+
+```
+
+### applyToDefaults(defaults, options)
+
+Apply options to a copy of the defaults
+
+```javascript
+
+var defaults = {host: "localhost", port: 8000};
+var options = {port: 8080};
+
+var config = Hoek.applyToDefaults(defaults, options); // results in {host: "localhost", port: 8080};
+
+
+```
+
+### unique(array, key)
+
+Remove duplicate items from Array
+
+```javascript
+
+var array = [1, 2, 2, 3, 3, 4, 5, 6];
+
+var newArray = Hoek.unique(array); // results in [1,2,3,4,5,6];
+
+array = [{id: 1}, {id: 1}, {id: 2}];
+
+newArray = Hoek.unique(array, "id") // results in [{id: 1}, {id: 2}]
+
+```
+
+### mapToObject(array, key)
+
+Convert an Array into an Object
+
+```javascript
+
+var array = [1,2,3];
+var newObject = Hoek.mapToObject(array); // results in [{"1": true}, {"2": true}, {"3": true}]
+
+array = [{id: 1}, {id: 2}];
+newObject = Hoek.mapToObject(array, "id") // results in [{"id": 1}, {"id": 2}]
+
+```
+### intersect(array1, array2)
+
+Find the common unique items in two arrays
+
+```javascript
+
+var array1 = [1, 2, 3];
+var array2 = [1, 4, 5];
+
+var newArray = Hoek.intersect(array1, array2) // results in [1]
+
+```
+
+### matchKeys(obj, keys) 
+
+Find which keys are present
+
+```javascript
+
+var obj = {a: 1, b: 2, c: 3};
+var keys = ["a", "e"];
+
+Hoek.matchKeys(obj, keys) // returns ["a"]
+
+```
+
+### flatten(array, target)
+
+Flatten an array
+
+```javascript
+
+var array = [1, 2, 3];
+var target = [4, 5]; 
+
+var flattenedArray = Hoek.flatten(array, target) // results in [4, 5, 1, 2, 3];
+
+```
+
+### removeKeys(object, keys)
+
+Remove keys
+
+```javascript
+
+var object = {a: 1, b: 2, c: 3, d: 4};
+
+var keys = ["a", "b"];
+
+Hoek.removeKeys(object, keys) // object is now {c: 3, d: 4}
+
+```
+
+### reach(obj, chain)
+
+Converts an object key chain string to reference
+
+```javascript
+
+var chain = 'a.b.c';
+var obj = {a : {b : { c : 1}}};
+
+Hoek.reach(obj, chain) // returns 1
+
+```
+
+### inheritAsync(self, obj, keys) 
+
+Inherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors
+
+```javascript
+
+var targetFunc = function () { };
+
+var proto = {
+                a: function () {
+                    return 'a!';
+                },
+                b: function () {
+                    return 'b!';
+                },
+                c: function () {
+                    throw new Error('c!');
+                }
+            };
+
+var keys = ['a', 'c'];
+
+Hoek.inheritAsync(targetFunc, proto, ['a', 'c']);
+
+var target = new targetFunc();
+
+target.a(function(err, result){console.log(result)}         // returns 'a!'       
+
+target.c(function(err, result){console.log(result)}         // returns undefined
+
+target.b(function(err, result){console.log(result)}         // gives error: Object [object Object] has no method 'b'
+
+```
+
+### rename(obj, from, to)
+
+Rename a key of an object
+
+```javascript
+
+var obj = {a : 1, b : 2};
+
+Hoek.rename(obj, "a", "c");     // obj is now {c : 1, b : 2}
+
+```
+
+
+# Timer
+
+A Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
+
+```javascript
+
+
+example : 
+
+
+var timerObj = new Hoek.Timer();
+console.log("Time is now: " + timerObj.ts)
+console.log("Elapsed time from initialization: " + timerObj.elapsed() + 'milliseconds')
+
+```
+
+# Binary Encoding/Decoding
+
+### base64urlEncode(value)
+
+Encodes value in Base64 or URL encoding
+
+### base64urlDecode(value)
+
+Decodes data in Base64 or URL encoding.
+# Escaping Characters
+
+Hoek provides convenient methods for escaping html characters. The escaped characters are as followed:
+
+```javascript
+
+internals.htmlEscaped = {
+    '&': '&amp;',
+    '<': '&lt;',
+    '>': '&gt;',
+    '"': '&quot;',
+    "'": '&#x27;',
+    '`': '&#x60;'
+};
+
+```
+
+### escapeHtml(string)
+
+```javascript
+
+var string = '<html> hey </html>';
+var escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;
+
+```
+
+### escapeHeaderAttribute(attribute)
+
+Escape attribute value for use in HTTP header
+
+```javascript
+
+var a = Hoek.escapeHeaderAttribute('I said "go w\\o me"');  //returns I said \"go w\\o me\"
+
+
+```
+
+
+### escapeRegex(string)
+
+Escape string for Regex construction
+
+```javascript
+
+var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,');  // returns 4\^f\$s\.4\*5\+\-_\?%\=#\!\:@\|~\\\/`"\(>\)\[<\]d\{\}s\,
+
+
+
+```
+
+# Errors
+
+### assert(message)
+
+```javascript
+
+var a = 1, b =2;
+
+Hoek.assert(a === b, 'a should equal b');  // ABORT: a should equal b
+
+```
+
+### abort(message)
+
+First checks if process.env.NODE_ENV === 'test', and if so, throws error message. Otherwise,
+displays most recent stack and then exits process.
+
+
+
+### displayStack(slice)
+
+Displays the trace stack
+
+```javascript
+
+var stack = Hoek.displayStack();
+console.log(stack) // returns something like:
+
+[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',
+  'Module._compile (module.js:449:26)',
+  'Module._extensions..js (module.js:467:10)',
+  'Module.load (module.js:356:32)',
+  'Module._load (module.js:312:12)',
+  'Module.runMain (module.js:492:10)',
+  'startup.processNextTick.process._tickCallback (node.js:244:9)' ]
+
+```
+
+### callStack(slice)
+
+Returns a trace stack array.
+
+```javascript
+
+var stack = Hoek.callStack();
+console.log(stack)  // returns something like:
+
+[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],
+  [ 'module.js', 449, 26, 'Module._compile', false ],
+  [ 'module.js', 467, 10, 'Module._extensions..js', false ],
+  [ 'module.js', 356, 32, 'Module.load', false ],
+  [ 'module.js', 312, 12, 'Module._load', false ],
+  [ 'module.js', 492, 10, 'Module.runMain', false ],
+  [ 'node.js',
+    244,
+    9,
+    'startup.processNextTick.process._tickCallback',
+    false ] ]
+
+
+```
+
+### toss(condition)
+
+toss(condition /*, [message], callback */)
+
+Return an error as first argument of a callback
+
+
+# Load Files
+
+### loadPackage(dir)
+
+Load and parse package.json process root or given directory
+
+```javascript
+
+var pack = Hoek.loadPackage();  // pack.name === 'hoek'
+
+```
+
+### loadDirModules(path, excludeFiles, target) 
+
+Loads modules from a given path; option to exclude files (array).
+
+
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/index.js	(revision 487)
@@ -0,0 +1,1 @@
+module.exports = require('./lib');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js	(revision 487)
@@ -0,0 +1,132 @@
+// Declare internals
+
+var internals = {};
+
+
+exports.escapeJavaScript = function (input) {
+
+    if (!input) {
+        return '';
+    }
+
+    var escaped = '';
+
+    for (var i = 0, il = input.length; i < il; ++i) {
+
+        var charCode = input.charCodeAt(i);
+
+        if (internals.isSafe(charCode)) {
+            escaped += input[i];
+        }
+        else {
+            escaped += internals.escapeJavaScriptChar(charCode);
+        }
+    }
+
+    return escaped;
+};
+
+
+exports.escapeHtml = function (input) {
+
+    if (!input) {
+        return '';
+    }
+
+    var escaped = '';
+
+    for (var i = 0, il = input.length; i < il; ++i) {
+
+        var charCode = input.charCodeAt(i);
+
+        if (internals.isSafe(charCode)) {
+            escaped += input[i];
+        }
+        else {
+            escaped += internals.escapeHtmlChar(charCode);
+        }
+    }
+
+    return escaped;
+};
+
+
+internals.escapeJavaScriptChar = function (charCode) {
+
+    if (charCode >= 256) {
+        return '\\u' + internals.padLeft('' + charCode, 4);
+    }
+
+    var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+    return '\\x' + internals.padLeft(hexValue, 2);
+};
+
+
+internals.escapeHtmlChar = function (charCode) {
+
+    var namedEscape = internals.namedHtml[charCode];
+    if (typeof namedEscape !== 'undefined') {
+        return namedEscape;
+    }
+
+    if (charCode >= 256) {
+        return '&#' + charCode + ';';
+    }
+
+    var hexValue = new Buffer(String.fromCharCode(charCode), 'ascii').toString('hex');
+    return '&#x' + internals.padLeft(hexValue, 2) + ';';
+};
+
+
+internals.padLeft = function (str, len) {
+
+    while (str.length < len) {
+        str = '0' + str;
+    }
+
+    return str;
+};
+
+
+internals.isSafe = function (charCode) {
+
+    return (typeof internals.safeCharCodes[charCode] !== 'undefined');
+};
+
+
+internals.namedHtml = {
+    '38': '&amp;',
+    '60': '&lt;',
+    '62': '&gt;',
+    '34': '&quot;',
+    '160': '&nbsp;',
+    '162': '&cent;',
+    '163': '&pound;',
+    '164': '&curren;',
+    '169': '&copy;',
+    '174': '&reg;'
+};
+
+
+internals.safeCharCodes = (function () {
+
+    var safe = {};
+
+    for (var i = 32; i < 123; ++i) {
+
+        if ((i >= 97 && i <= 122) ||         // a-z
+            (i >= 65 && i <= 90) ||          // A-Z
+            (i >= 48 && i <= 57) ||          // 0-9
+            i === 32 ||                      // space
+            i === 46 ||                      // .
+            i === 44 ||                      // ,
+            i === 45 ||                      // -
+            i === 58 ||                      // :
+            i === 95) {                      // _
+
+            safe[i] = null;
+        }
+    }
+
+    return safe;
+}());
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js	(revision 487)
@@ -0,0 +1,585 @@
+// Load modules
+
+var Fs = require('fs');
+var Escape = require('./escape');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Clone object or array
+
+exports.clone = function (obj, seen) {
+
+    if (typeof obj !== 'object' ||
+        obj === null) {
+
+        return obj;
+    }
+
+    seen = seen || { orig: [], copy: [] };
+
+    var lookup = seen.orig.indexOf(obj);
+    if (lookup !== -1) {
+        return seen.copy[lookup];
+    }
+
+    var newObj = (obj instanceof Array) ? [] : {};
+
+    seen.orig.push(obj);
+    seen.copy.push(newObj);
+
+    for (var i in obj) {
+        if (obj.hasOwnProperty(i)) {
+            if (obj[i] instanceof Buffer) {
+                newObj[i] = new Buffer(obj[i]);
+            }
+            else if (obj[i] instanceof Date) {
+                newObj[i] = new Date(obj[i].getTime());
+            }
+            else if (obj[i] instanceof RegExp) {
+                var flags = '' + (obj[i].global ? 'g' : '') + (obj[i].ignoreCase ? 'i' : '') + (obj[i].multiline ? 'm' : '');
+                newObj[i] = new RegExp(obj[i].source, flags);
+            }
+            else {
+                newObj[i] = exports.clone(obj[i], seen);
+            }
+        }
+    }
+
+    return newObj;
+};
+
+
+// Merge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied
+
+exports.merge = function (target, source, isNullOverride /* = true */, isMergeArrays /* = true */) {
+
+    exports.assert(target && typeof target == 'object', 'Invalid target value: must be an object');
+    exports.assert(source === null || source === undefined || typeof source === 'object', 'Invalid source value: must be null, undefined, or an object');
+
+    if (!source) {
+        return target;
+    }
+
+    if (source instanceof Array) {
+        exports.assert(target instanceof Array, 'Cannot merge array onto an object');
+        if (isMergeArrays === false) {                                                  // isMergeArrays defaults to true
+            target.length = 0;                                                          // Must not change target assignment
+        }
+
+        for (var i = 0, il = source.length; i < il; ++i) {
+            target.push(source[i]);
+        }
+
+        return target;
+    }
+
+    var keys = Object.keys(source);
+    for (var k = 0, kl = keys.length; k < kl; ++k) {
+        var key = keys[k];
+        var value = source[key];
+        if (value &&
+            typeof value === 'object') {
+
+            if (!target[key] ||
+                typeof target[key] !== 'object') {
+
+                target[key] = exports.clone(value);
+            }
+            else {
+                exports.merge(target[key], source[key], isNullOverride, isMergeArrays);
+            }
+        }
+        else {
+            if (value !== null && value !== undefined) {            // Explicit to preserve empty strings
+                target[key] = value;
+            }
+            else if (isNullOverride !== false) {                    // Defaults to true
+                target[key] = value;
+            }
+        }
+    }
+
+    return target;
+};
+
+
+// Apply options to a copy of the defaults
+
+exports.applyToDefaults = function (defaults, options) {
+
+    exports.assert(defaults && typeof defaults == 'object', 'Invalid defaults value: must be an object');
+    exports.assert(!options || options === true || typeof options === 'object', 'Invalid options value: must be true, falsy or an object');
+
+    if (!options) {                                                 // If no options, return null
+        return null;
+    }
+
+    var copy = exports.clone(defaults);
+
+    if (options === true) {                                         // If options is set to true, use defaults
+        return copy;
+    }
+
+    return exports.merge(copy, options, false, false);
+};
+
+
+// Remove duplicate items from array
+
+exports.unique = function (array, key) {
+
+    var index = {};
+    var result = [];
+
+    for (var i = 0, il = array.length; i < il; ++i) {
+        var id = (key ? array[i][key] : array[i]);
+        if (index[id] !== true) {
+
+            result.push(array[i]);
+            index[id] = true;
+        }
+    }
+
+    return result;
+};
+
+
+// Convert array into object
+
+exports.mapToObject = function (array, key) {
+
+    if (!array) {
+        return null;
+    }
+
+    var obj = {};
+    for (var i = 0, il = array.length; i < il; ++i) {
+        if (key) {
+            if (array[i][key]) {
+                obj[array[i][key]] = true;
+            }
+        }
+        else {
+            obj[array[i]] = true;
+        }
+    }
+
+    return obj;
+};
+
+
+// Find the common unique items in two arrays
+
+exports.intersect = function (array1, array2, justFirst) {
+
+    if (!array1 || !array2) {
+        return [];
+    }
+
+    var common = [];
+    var hash = (array1 instanceof Array ? exports.mapToObject(array1) : array1);
+    var found = {};
+    for (var i = 0, il = array2.length; i < il; ++i) {
+        if (hash[array2[i]] && !found[array2[i]]) {
+            if (justFirst) {
+                return array2[i];
+            }
+
+            common.push(array2[i]);
+            found[array2[i]] = true;
+        }
+    }
+
+    return (justFirst ? null : common);
+};
+
+
+// Find which keys are present
+
+exports.matchKeys = function (obj, keys) {
+
+    var matched = [];
+    for (var i = 0, il = keys.length; i < il; ++i) {
+        if (obj.hasOwnProperty(keys[i])) {
+            matched.push(keys[i]);
+        }
+    }
+    return matched;
+};
+
+
+// Flatten array
+
+exports.flatten = function (array, target) {
+
+    var result = target || [];
+
+    for (var i = 0, il = array.length; i < il; ++i) {
+        if (Array.isArray(array[i])) {
+            exports.flatten(array[i], result);
+        }
+        else {
+            result.push(array[i]);
+        }
+    }
+
+    return result;
+};
+
+
+// Remove keys
+
+exports.removeKeys = function (object, keys) {
+
+    for (var i = 0, il = keys.length; i < il; i++) {
+        delete object[keys[i]];
+    }
+};
+
+
+// Convert an object key chain string ('a.b.c') to reference (object[a][b][c])
+
+exports.reach = function (obj, chain) {
+
+    var path = chain.split('.');
+    var ref = obj;
+    for (var i = 0, il = path.length; i < il; ++i) {
+        if (ref) {
+            ref = ref[path[i]];
+        }
+    }
+
+    return ref;
+};
+
+
+// Inherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors
+
+exports.inheritAsync = function (self, obj, keys) {
+
+    keys = keys || null;
+
+    for (var i in obj) {
+        if (obj.hasOwnProperty(i)) {
+            if (keys instanceof Array &&
+                keys.indexOf(i) < 0) {
+
+                continue;
+            }
+
+            self.prototype[i] = (function (fn) {
+
+                return function (next) {
+
+                    var result = null;
+                    try {
+                        result = fn();
+                    }
+                    catch (err) {
+                        return next(err);
+                    }
+
+                    return next(null, result);
+                };
+            })(obj[i]);
+        }
+    }
+};
+
+
+exports.formatStack = function (stack) {
+
+    var trace = [];
+    for (var i = 0, il = stack.length; i < il; ++i) {
+        var item = stack[i];
+        trace.push([item.getFileName(), item.getLineNumber(), item.getColumnNumber(), item.getFunctionName(), item.isConstructor()]);
+    }
+
+    return trace;
+};
+
+
+exports.formatTrace = function (trace) {
+
+    var display = [];
+
+    for (var i = 0, il = trace.length; i < il; ++i) {
+        var row = trace[i];
+        display.push((row[4] ? 'new ' : '') + row[3] + ' (' + row[0] + ':' + row[1] + ':' + row[2] + ')');
+    }
+
+    return display;
+};
+
+
+exports.callStack = function (slice) {
+
+    // http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
+
+    var v8 = Error.prepareStackTrace;
+    Error.prepareStackTrace = function (err, stack) {
+
+        return stack;
+    };
+
+    var capture = {};
+    Error.captureStackTrace(capture, arguments.callee);
+    var stack = capture.stack;
+
+    Error.prepareStackTrace = v8;
+
+    var trace = exports.formatStack(stack);
+
+    if (slice) {
+        return trace.slice(slice);
+    }
+
+    return trace;
+};
+
+
+exports.displayStack = function (slice) {
+
+    var trace = exports.callStack(slice === undefined ? 1 : slice + 1);
+
+    return exports.formatTrace(trace);
+};
+
+
+exports.abortThrow = false;
+
+
+exports.abort = function (message, hideStack) {
+
+    if (process.env.NODE_ENV === 'test' || exports.abortThrow === true) {
+        throw new Error(message || 'Unknown error');
+    }
+
+    var stack = '';
+    if (!hideStack) {
+        stack = exports.displayStack(1).join('\n\t');
+    }
+    console.log('ABORT: ' + message + '\n\t' + stack);
+    process.exit(1);
+};
+
+
+exports.assert = function (condition /*, msg1, msg2, msg3 */) {
+
+    if (condition) {
+        return;
+    }
+
+    var msgs = Array.prototype.slice.call(arguments, 1);
+    msgs = msgs.map(function (msg) {
+
+        return typeof msg === 'string' ? msg : msg instanceof Error ? msg.message : JSON.stringify(msg);
+    });
+    throw new Error(msgs.join(' ') || 'Unknown error');
+};
+
+
+exports.loadDirModules = function (path, excludeFiles, target) {      // target(filename, name, capName)
+
+    var exclude = {};
+    for (var i = 0, il = excludeFiles.length; i < il; ++i) {
+        exclude[excludeFiles[i] + '.js'] = true;
+    }
+
+    var files = Fs.readdirSync(path);
+    for (i = 0, il = files.length; i < il; ++i) {
+        var filename = files[i];
+        if (/\.js$/.test(filename) &&
+            !exclude[filename]) {
+
+            var name = filename.substr(0, filename.lastIndexOf('.'));
+            var capName = name.charAt(0).toUpperCase() + name.substr(1).toLowerCase();
+
+            if (typeof target !== 'function') {
+                target[capName] = require(path + '/' + name);
+            }
+            else {
+                target(path + '/' + name, name, capName);
+            }
+        }
+    }
+};
+
+
+exports.rename = function (obj, from, to) {
+
+    obj[to] = obj[from];
+    delete obj[from];
+};
+
+
+exports.Timer = function () {
+
+    this.reset();
+};
+
+
+exports.Timer.prototype.reset = function () {
+
+    this.ts = Date.now();
+};
+
+
+exports.Timer.prototype.elapsed = function () {
+
+    return Date.now() - this.ts;
+};
+
+
+// Load and parse package.json process root or given directory
+
+exports.loadPackage = function (dir) {
+
+    var result = {};
+    var filepath = (dir || process.env.PWD) + '/package.json';
+    if (Fs.existsSync(filepath)) {
+        try {
+            result = JSON.parse(Fs.readFileSync(filepath));
+        }
+        catch (e) { }
+    }
+
+    return result;
+};
+
+
+// Escape string for Regex construction
+
+exports.escapeRegex = function (string) {
+
+    // Escape ^$.*+-?=!:|\/()[]{},
+    return string.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g, '\\$&');
+};
+
+
+// Return an error as first argument of a callback
+
+exports.toss = function (condition /*, [message], next */) {
+
+    var message = (arguments.length === 3 ? arguments[1] : '');
+    var next = (arguments.length === 3 ? arguments[2] : arguments[1]);
+
+    var err = (message instanceof Error ? message : (message ? new Error(message) : (condition instanceof Error ? condition : new Error())));
+
+    if (condition instanceof Error ||
+        !condition) {
+
+        return next(err);
+    }
+};
+
+
+// Base64url (RFC 4648) encode
+
+exports.base64urlEncode = function (value) {
+
+    return (new Buffer(value, 'binary')).toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/\=/g, '');
+};
+
+
+// Base64url (RFC 4648) decode
+
+exports.base64urlDecode = function (encoded) {
+
+    if (encoded &&
+        !encoded.match(/^[\w\-]*$/)) {
+
+        return new Error('Invalid character');
+    }
+
+    try {
+        return (new Buffer(encoded.replace(/-/g, '+').replace(/:/g, '/'), 'base64')).toString('binary');
+    }
+    catch (err) {
+        return err;
+    }
+};
+
+
+// Escape attribute value for use in HTTP header
+
+exports.escapeHeaderAttribute = function (attribute) {
+
+    // Allowed value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9, \, "
+
+    exports.assert(attribute.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~\"\\]*$/), 'Bad attribute value (' + attribute + ')');
+
+    return attribute.replace(/\\/g, '\\\\').replace(/\"/g, '\\"');                             // Escape quotes and slash
+};
+
+
+exports.escapeHtml = function (string) {
+
+    return Escape.escapeHtml(string);
+};
+
+
+exports.escapeJavaScript = function (string) {
+
+    return Escape.escapeJavaScript(string);
+};
+
+
+/*
+var event = {
+    timestamp: now.getTime(),
+    tags: ['tag'],
+    data: { some: 'data' }
+};
+*/
+
+exports.consoleFunc = console.log;
+
+exports.printEvent = function (event) {
+
+    var pad = function (value) {
+
+        return (value < 10 ? '0' : '') + value;
+    };
+
+    var now = new Date(event.timestamp);
+    var timestring = (now.getYear() - 100).toString() +
+        pad(now.getMonth() + 1) +
+        pad(now.getDate()) +
+        '/' +
+        pad(now.getHours()) +
+        pad(now.getMinutes()) +
+        pad(now.getSeconds()) +
+        '.' +
+        now.getMilliseconds();
+
+    var data = event.data;
+    if (typeof event.data !== 'string') {
+        try {
+            data = JSON.stringify(event.data);
+        }
+        catch (e) {
+            data = 'JSON Error: ' + e.message;
+        }
+    }
+
+    var output = timestring + ', ' + event.tags[0] + ', ' + data;
+    exports.consoleFunc(output);
+};
+
+
+exports.nextTick = function (callback) {
+
+    return function () {
+
+        var args = arguments;
+        process.nextTick(function () {
+
+            callback.apply(null, args);
+        });
+    };
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/package.json	(revision 487)
@@ -0,0 +1,49 @@
+{
+  "name": "hoek",
+  "description": "General purpose node utilities",
+  "version": "0.9.1",
+  "author": {
+    "name": "Eran Hammer",
+    "email": "eran@hueniverse.com",
+    "url": "http://hueniverse.com"
+  },
+  "contributors": [
+    {
+      "name": "Van Nguyen",
+      "email": "the.gol.effect@gmail.com"
+    }
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/spumko/hoek"
+  },
+  "main": "index",
+  "keywords": [
+    "utilities"
+  ],
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "lab": "0.1.x",
+    "complexity-report": "0.x.x"
+  },
+  "scripts": {
+    "test": "make test-cov"
+  },
+  "licenses": [
+    {
+      "type": "BSD",
+      "url": "http://github.com/spumko/hoek/raw/master/LICENSE"
+    }
+  ],
+  "readme": "<a href=\"https://github.com/spumko\"><img src=\"https://raw.github.com/spumko/spumko/master/images/from.png\" align=\"right\" /></a>\r\n![hoek Logo](https://raw.github.com/spumko/hoek/master/images/hoek.png)\r\n\r\nGeneral purpose node utilities\r\n\r\n[![Build Status](https://secure.travis-ci.org/spumko/hoek.png)](http://travis-ci.org/spumko/hoek)\r\n\r\n# Table of Contents\r\n\r\n* [Introduction](#introduction \"Introduction\")\r\n* [Object](#object \"Object\")\r\n  * [clone](#cloneobj \"clone\")\r\n  * [merge](#mergetarget-source-isnulloverride-ismergearrays \"merge\")\r\n  * [applyToDefaults](#applytodefaultsdefaults-options \"applyToDefaults\")\r\n  * [unique](#uniquearray-key \"unique\")\r\n  * [mapToObject](#maptoobjectarray-key \"mapToObject\")\r\n  * [intersect](#intersectarray1-array2 \"intersect\")\r\n  * [matchKeys](#matchkeysobj-keys \"matchKeys\")\r\n  * [flatten](#flattenarray-target \"flatten\")\r\n  * [removeKeys](#removekeysobject-keys \"removeKeys\")\r\n  * [reach](#reachobj-chain \"reach\")\r\n  * [inheritAsync](#inheritasyncself-obj-keys \"inheritAsync\")\r\n  * [rename](#renameobj-from-to \"rename\")\r\n* [Timer](#timer \"Timer\")\r\n* [Binary Encoding/Decoding](#binary \"Binary Encoding/Decoding\")\r\n  * [base64urlEncode](#binary64urlEncodevalue \"binary64urlEncode\")\r\n  * [base64urlDecode](#binary64urlDecodevalue \"binary64urlDecode\")\r\n* [Escaping Characters](#escaped \"Escaping Characters\")\r\n  * [escapeHtml](#escapeHtmlstring \"escapeHtml\")\r\n  * [escapeHeaderAttribute](#escapeHeaderAttributeattribute \"escapeHeaderAttribute\")\r\n  * [escapeRegex](#escapeRegexstring \"escapeRegex\")\r\n* [Errors](#errors \"Errors\")\r\n  * [assert](#assertmessage \"assert\")\r\n  * [abort](#abortmessage \"abort\")\r\n  * [displayStack](#displayStackslice \"displayStack\")\r\n  * [callStack](#callStackslice \"callStack\")\r\n  * [toss](#tosscondition \"toss\")\r\n* [Load files](#load-files \"Load Files\")\r\n  * [loadPackage](#loadPackagedir \"loadpackage\")\r\n  * [loadDirModules](#loadDirModulespath-excludefiles-target \"loaddirmodules\")\r\n\r\n\r\n\r\n# Introduction\r\n\r\nThe *Hoek* general purpose node utilities library is used to aid in a variety of manners. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more. \r\n\r\nFor example, to use Hoek to set configuration with default options:\r\n```javascript\r\nvar Hoek = require('hoek');\r\n\r\nvar default = {url : \"www.github.com\", port : \"8000\", debug : true}\r\n\r\nvar config = Hoek.applyToDefaults(default, {port : \"3000\", admin : true});\r\n\r\n// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }\r\n```\r\n\r\nUnder each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the var Hoek = require('hoek') is omitted for brevity.\r\n\r\n## Object\r\n\r\nHoek provides several helpful methods for objects and arrays.\r\n\r\n### clone(obj)\r\n\r\nThis method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects). \r\n\r\n```javascript\r\n\r\nvar nestedObj = {\r\n        w: /^something$/ig,\r\n        x: {\r\n            a: [1, 2, 3],\r\n            b: 123456,\r\n            c: new Date()\r\n        },\r\n        y: 'y',\r\n        z: new Date()\r\n    };\r\n\r\nvar copy = Hoek.clone(nestedObj);\r\n\r\ncopy.x.b = 100;\r\n\r\nconsole.log(copy.y)        // results in 'y'\r\nconsole.log(nestedObj.x.b) // results in 123456\r\nconsole.log(copy.x.b)      // results in 100\r\n```\r\n\r\n### merge(target, source, isNullOverride, isMergeArrays)\r\nisNullOverride, isMergeArrays default to true\r\n\r\nMerge all the properties of source into target, source wins in conflic, and by default null and undefined from source are applied\r\n\r\n\r\n```javascript\r\n\r\nvar target = {a: 1, b : 2}\r\nvar source = {a: 0, c: 5}\r\nvar source2 = {a: null, c: 5}\r\n\r\nvar targetArray = [1, 2, 3];\r\nvar sourceArray = [4, 5];\r\n\r\nvar newTarget = Hoek.merge(target, source);     // results in {a: 0, b: 2, c: 5}\r\nnewTarget = Hoek.merge(target, source2);        // results in {a: null, b: 2, c: 5}\r\nnewTarget = Hoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}\r\n\r\nnewTarget = Hoek.merge(targetArray, sourceArray)              // results in [1, 2, 3, 4, 5]\r\nnewTarget = Hoek.merge(targetArray, sourceArray, true, false) // results in [4, 5]\r\n\r\n\r\n\r\n\r\n```\r\n\r\n### applyToDefaults(defaults, options)\r\n\r\nApply options to a copy of the defaults\r\n\r\n```javascript\r\n\r\nvar defaults = {host: \"localhost\", port: 8000};\r\nvar options = {port: 8080};\r\n\r\nvar config = Hoek.applyToDefaults(defaults, options); // results in {host: \"localhost\", port: 8080};\r\n\r\n\r\n```\r\n\r\n### unique(array, key)\r\n\r\nRemove duplicate items from Array\r\n\r\n```javascript\r\n\r\nvar array = [1, 2, 2, 3, 3, 4, 5, 6];\r\n\r\nvar newArray = Hoek.unique(array); // results in [1,2,3,4,5,6];\r\n\r\narray = [{id: 1}, {id: 1}, {id: 2}];\r\n\r\nnewArray = Hoek.unique(array, \"id\") // results in [{id: 1}, {id: 2}]\r\n\r\n```\r\n\r\n### mapToObject(array, key)\r\n\r\nConvert an Array into an Object\r\n\r\n```javascript\r\n\r\nvar array = [1,2,3];\r\nvar newObject = Hoek.mapToObject(array); // results in [{\"1\": true}, {\"2\": true}, {\"3\": true}]\r\n\r\narray = [{id: 1}, {id: 2}];\r\nnewObject = Hoek.mapToObject(array, \"id\") // results in [{\"id\": 1}, {\"id\": 2}]\r\n\r\n```\r\n### intersect(array1, array2)\r\n\r\nFind the common unique items in two arrays\r\n\r\n```javascript\r\n\r\nvar array1 = [1, 2, 3];\r\nvar array2 = [1, 4, 5];\r\n\r\nvar newArray = Hoek.intersect(array1, array2) // results in [1]\r\n\r\n```\r\n\r\n### matchKeys(obj, keys) \r\n\r\nFind which keys are present\r\n\r\n```javascript\r\n\r\nvar obj = {a: 1, b: 2, c: 3};\r\nvar keys = [\"a\", \"e\"];\r\n\r\nHoek.matchKeys(obj, keys) // returns [\"a\"]\r\n\r\n```\r\n\r\n### flatten(array, target)\r\n\r\nFlatten an array\r\n\r\n```javascript\r\n\r\nvar array = [1, 2, 3];\r\nvar target = [4, 5]; \r\n\r\nvar flattenedArray = Hoek.flatten(array, target) // results in [4, 5, 1, 2, 3];\r\n\r\n```\r\n\r\n### removeKeys(object, keys)\r\n\r\nRemove keys\r\n\r\n```javascript\r\n\r\nvar object = {a: 1, b: 2, c: 3, d: 4};\r\n\r\nvar keys = [\"a\", \"b\"];\r\n\r\nHoek.removeKeys(object, keys) // object is now {c: 3, d: 4}\r\n\r\n```\r\n\r\n### reach(obj, chain)\r\n\r\nConverts an object key chain string to reference\r\n\r\n```javascript\r\n\r\nvar chain = 'a.b.c';\r\nvar obj = {a : {b : { c : 1}}};\r\n\r\nHoek.reach(obj, chain) // returns 1\r\n\r\n```\r\n\r\n### inheritAsync(self, obj, keys) \r\n\r\nInherits a selected set of methods from an object, wrapping functions in asynchronous syntax and catching errors\r\n\r\n```javascript\r\n\r\nvar targetFunc = function () { };\r\n\r\nvar proto = {\r\n                a: function () {\r\n                    return 'a!';\r\n                },\r\n                b: function () {\r\n                    return 'b!';\r\n                },\r\n                c: function () {\r\n                    throw new Error('c!');\r\n                }\r\n            };\r\n\r\nvar keys = ['a', 'c'];\r\n\r\nHoek.inheritAsync(targetFunc, proto, ['a', 'c']);\r\n\r\nvar target = new targetFunc();\r\n\r\ntarget.a(function(err, result){console.log(result)}         // returns 'a!'       \r\n\r\ntarget.c(function(err, result){console.log(result)}         // returns undefined\r\n\r\ntarget.b(function(err, result){console.log(result)}         // gives error: Object [object Object] has no method 'b'\r\n\r\n```\r\n\r\n### rename(obj, from, to)\r\n\r\nRename a key of an object\r\n\r\n```javascript\r\n\r\nvar obj = {a : 1, b : 2};\r\n\r\nHoek.rename(obj, \"a\", \"c\");     // obj is now {c : 1, b : 2}\r\n\r\n```\r\n\r\n\r\n# Timer\r\n\r\nA Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\r\n\r\n```javascript\r\n\r\n\r\nexample : \r\n\r\n\r\nvar timerObj = new Hoek.Timer();\r\nconsole.log(\"Time is now: \" + timerObj.ts)\r\nconsole.log(\"Elapsed time from initialization: \" + timerObj.elapsed() + 'milliseconds')\r\n\r\n```\r\n\r\n# Binary Encoding/Decoding\r\n\r\n### base64urlEncode(value)\r\n\r\nEncodes value in Base64 or URL encoding\r\n\r\n### base64urlDecode(value)\r\n\r\nDecodes data in Base64 or URL encoding.\r\n# Escaping Characters\r\n\r\nHoek provides convenient methods for escaping html characters. The escaped characters are as followed:\r\n\r\n```javascript\r\n\r\ninternals.htmlEscaped = {\r\n    '&': '&amp;',\r\n    '<': '&lt;',\r\n    '>': '&gt;',\r\n    '\"': '&quot;',\r\n    \"'\": '&#x27;',\r\n    '`': '&#x60;'\r\n};\r\n\r\n```\r\n\r\n### escapeHtml(string)\r\n\r\n```javascript\r\n\r\nvar string = '<html> hey </html>';\r\nvar escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;\r\n\r\n```\r\n\r\n### escapeHeaderAttribute(attribute)\r\n\r\nEscape attribute value for use in HTTP header\r\n\r\n```javascript\r\n\r\nvar a = Hoek.escapeHeaderAttribute('I said \"go w\\\\o me\"');  //returns I said \\\"go w\\\\o me\\\"\r\n\r\n\r\n```\r\n\r\n\r\n### escapeRegex(string)\r\n\r\nEscape string for Regex construction\r\n\r\n```javascript\r\n\r\nvar a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\\\/`\"(>)[<]d{}s,');  // returns 4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`\"\\(>\\)\\[<\\]d\\{\\}s\\,\r\n\r\n\r\n\r\n```\r\n\r\n# Errors\r\n\r\n### assert(message)\r\n\r\n```javascript\r\n\r\nvar a = 1, b =2;\r\n\r\nHoek.assert(a === b, 'a should equal b');  // ABORT: a should equal b\r\n\r\n```\r\n\r\n### abort(message)\r\n\r\nFirst checks if process.env.NODE_ENV === 'test', and if so, throws error message. Otherwise,\r\ndisplays most recent stack and then exits process.\r\n\r\n\r\n\r\n### displayStack(slice)\r\n\r\nDisplays the trace stack\r\n\r\n```javascript\r\n\r\nvar stack = Hoek.displayStack();\r\nconsole.log(stack) // returns something like:\r\n\r\n[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',\r\n  'Module._compile (module.js:449:26)',\r\n  'Module._extensions..js (module.js:467:10)',\r\n  'Module.load (module.js:356:32)',\r\n  'Module._load (module.js:312:12)',\r\n  'Module.runMain (module.js:492:10)',\r\n  'startup.processNextTick.process._tickCallback (node.js:244:9)' ]\r\n\r\n```\r\n\r\n### callStack(slice)\r\n\r\nReturns a trace stack array.\r\n\r\n```javascript\r\n\r\nvar stack = Hoek.callStack();\r\nconsole.log(stack)  // returns something like:\r\n\r\n[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],\r\n  [ 'module.js', 449, 26, 'Module._compile', false ],\r\n  [ 'module.js', 467, 10, 'Module._extensions..js', false ],\r\n  [ 'module.js', 356, 32, 'Module.load', false ],\r\n  [ 'module.js', 312, 12, 'Module._load', false ],\r\n  [ 'module.js', 492, 10, 'Module.runMain', false ],\r\n  [ 'node.js',\r\n    244,\r\n    9,\r\n    'startup.processNextTick.process._tickCallback',\r\n    false ] ]\r\n\r\n\r\n```\r\n\r\n### toss(condition)\r\n\r\ntoss(condition /*, [message], callback */)\r\n\r\nReturn an error as first argument of a callback\r\n\r\n\r\n# Load Files\r\n\r\n### loadPackage(dir)\r\n\r\nLoad and parse package.json process root or given directory\r\n\r\n```javascript\r\n\r\nvar pack = Hoek.loadPackage();  // pack.name === 'hoek'\r\n\r\n```\r\n\r\n### loadDirModules(path, excludeFiles, target) \r\n\r\nLoads modules from a given path; option to exclude files (array).\r\n\r\n\r\n\r\n\r\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/spumko/hoek/issues"
+  },
+  "homepage": "https://github.com/spumko/hoek",
+  "_id": "hoek@0.9.1",
+  "_from": "hoek@0.9.x"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js	(revision 487)
@@ -0,0 +1,86 @@
+// Load modules
+
+var Lab = require('lab');
+var Hoek = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hoek', function () {
+
+    describe('#escapeJavaScript', function () {
+
+        it('encodes / characters', function (done) {
+
+            var encoded = Hoek.escapeJavaScript('<script>alert(1)</script>');
+            expect(encoded).to.equal('\\x3cscript\\x3ealert\\x281\\x29\\x3c\\x2fscript\\x3e');
+            done();
+        });
+
+        it('encodes \' characters', function (done) {
+
+            var encoded = Hoek.escapeJavaScript('something(\'param\')');
+            expect(encoded).to.equal('something\\x28\\x27param\\x27\\x29');
+            done();
+        });
+
+        it('encodes large unicode characters with the correct padding', function (done) {
+
+            var encoded = Hoek.escapeJavaScript(String.fromCharCode(500) + String.fromCharCode(1000));
+            expect(encoded).to.equal('\\u0500\\u1000');
+            done();
+        });
+
+        it('doesn\'t throw an exception when passed null', function (done) {
+
+            var encoded = Hoek.escapeJavaScript(null);
+            expect(encoded).to.equal('');
+            done();
+        });
+    });
+
+    describe('#escapeHtml', function () {
+
+        it('encodes / characters', function (done) {
+
+            var encoded = Hoek.escapeHtml('<script>alert(1)</script>');
+            expect(encoded).to.equal('&lt;script&gt;alert&#x28;1&#x29;&lt;&#x2f;script&gt;');
+            done();
+        });
+
+        it('encodes < and > as named characters', function (done) {
+
+            var encoded = Hoek.escapeHtml('<script><>');
+            expect(encoded).to.equal('&lt;script&gt;&lt;&gt;');
+            done();
+        });
+
+        it('encodes large unicode characters', function (done) {
+
+            var encoded = Hoek.escapeHtml(String.fromCharCode(500) + String.fromCharCode(1000));
+            expect(encoded).to.equal('&#500;&#1000;');
+            done();
+        });
+
+        it('doesn\'t throw an exception when passed null', function (done) {
+
+            var encoded = Hoek.escapeHtml(null);
+            expect(encoded).to.equal('');
+            done();
+        });
+    });
+});
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js	(revision 487)
@@ -0,0 +1,1078 @@
+// Load modules
+
+var Lab = require('lab');
+var Hoek = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hoek', function () {
+
+    var nestedObj = {
+        v: [7,8,9],
+        w: /^something$/igm,
+        x: {
+            a: [1, 2, 3],
+            b: 123456,
+            c: new Date(),
+            d: /hi/igm,
+            e: /hello/
+        },
+        y: 'y',
+        z: new Date()
+    };
+
+    var dupsArray = [nestedObj, { z: 'z' }, nestedObj];
+    var reducedDupsArray = [nestedObj, { z: 'z' }];
+
+    describe('#clone', function () {
+
+        it('should clone a nested object', function (done) {
+
+            var a = nestedObj;
+            var b = Hoek.clone(a);
+
+            expect(a).to.deep.equal(b);
+            expect(a.z.getTime()).to.equal(b.z.getTime());
+            done();
+        });
+
+        it('should clone a null object', function (done) {
+
+            var b = Hoek.clone(null);
+
+            expect(b).to.equal(null);
+            done();
+        });
+
+        it('should not convert undefined properties to null', function (done) {
+
+            var obj = { something: undefined };
+            var b = Hoek.clone(obj);
+
+            expect(typeof b.something).to.equal('undefined');
+            done();
+        });
+
+        it('should not throw on circular reference', function (done) {
+
+            var a = {};
+            a.x = a;
+
+            var test = (function () {
+
+                var b = Hoek.clone(a);
+            });
+
+            expect(test).to.not.throw();
+            done();
+        });
+
+        it('should properly clone circular reference', function (done) {
+
+            var x = {
+                'z': new Date()
+            };
+            x.y = x;
+
+            var b = Hoek.clone(x);
+            expect(Object.keys(b.y)).to.deep.equal(Object.keys(x))
+            expect(b.z).to.not.equal(x.z);
+            expect(b.y).to.not.equal(x.y);
+            expect(b.y.z).to.not.equal(x.y.z);
+            expect(b.y).to.equal(b);
+            expect(b.y.y.y.y).to.equal(b);
+            done();
+        });
+
+        it('should properly clone deeply nested object', function (done) {
+
+            var a = {
+                x: {
+                    y: {
+                        a: [1, 2, 3],
+                        b: 123456,
+                        c: new Date(),
+                        d: /hi/igm,
+                        e: /hello/
+                    },
+                }
+            };
+
+            var b = Hoek.clone(a);
+
+            expect(a).to.deep.equal(b);
+            expect(a.x.y.c.getTime()).to.equal(b.x.y.c.getTime());
+            done();
+        });
+
+        it('should properly clone arrays', function (done) {
+
+            var a = [1,2,3];
+
+            var b = Hoek.clone(a);
+
+            expect(a).to.deep.equal(b);
+            done();
+        });
+
+        it('should perform actual copy for shallow keys (no pass by reference)', function (done) {
+
+            var x = Hoek.clone(nestedObj);
+            var y = Hoek.clone(nestedObj);
+
+            // Date
+            expect(x.z).to.not.equal(nestedObj.z);
+            expect(x.z).to.not.equal(y.z);
+
+            // Regex
+            expect(x.w).to.not.equal(nestedObj.w);
+            expect(x.w).to.not.equal(y.w);
+
+            // Array
+            expect(x.v).to.not.equal(nestedObj.v);
+            expect(x.v).to.not.equal(y.v);
+
+            // Immutable(s)
+            x.y = 5;
+            expect(x.y).to.not.equal(nestedObj.y);
+            expect(x.y).to.not.equal(y.y);
+
+            done();
+        });
+
+        it('should perform actual copy for deep keys (no pass by reference)', function (done) {
+
+            var x = Hoek.clone(nestedObj);
+            var y = Hoek.clone(nestedObj);
+
+            expect(x.x.c).to.not.equal(nestedObj.x.c);
+            expect(x.x.c).to.not.equal(y.x.c);
+
+            expect(x.x.c.getTime()).to.equal(nestedObj.x.c.getTime());
+            expect(x.x.c.getTime()).to.equal(y.x.c.getTime());
+            done();
+        });
+
+        it('copies functions with properties', function (done) {
+
+            var a = {
+                x: function () { return 1; },
+                y: {}
+            };
+            a.x.z = 'string in function';
+            a.x.v = function () { return 2; };
+            a.y.u = a.x;
+
+            var b = Hoek.clone(a);
+            expect(b.x()).to.equal(1);
+            expect(b.x.v()).to.equal(2);
+            expect(b.y.u).to.equal(b.x);
+            expect(b.x.z).to.equal('string in function');
+            done();
+        });
+
+        it('should copy a buffer', function(done){
+            var tls = {
+                key: new Buffer([1,2,3,4,5]),
+                cert: new Buffer([1,2,3,4,5,6,10])
+            }
+
+            copiedTls = Hoek.clone(tls);
+            expect(Buffer.isBuffer(copiedTls.key)).to.equal(true);
+            expect(JSON.stringify(copiedTls.key)).to.equal(JSON.stringify(tls.key))
+            expect(Buffer.isBuffer(copiedTls.cert)).to.equal(true);
+            expect(JSON.stringify(copiedTls.cert)).to.equal(JSON.stringify(tls.cert))
+            done();
+        });
+    });
+
+    describe('#merge', function () {
+
+        it('does not throw if source is null', function (done) {
+
+            var a = {};
+            var b = null;
+            var c = null;
+
+            expect(function () {
+
+                c = Hoek.merge(a, b);
+            }).to.not.throw();
+
+            expect(c).to.equal(a);
+            done();
+        });
+
+        it('does not throw if source is undefined', function (done) {
+
+            var a = {};
+            var b = undefined;
+            var c = null;
+
+            expect(function () {
+
+                c = Hoek.merge(a, b);
+            }).to.not.throw();
+
+            expect(c).to.equal(a);
+            done();
+        });
+
+        it('throws if source is not an object', function (done) {
+
+            expect(function () {
+
+                var a = {};
+                var b = 0;
+
+                Hoek.merge(a, b);
+            }).to.throw('Invalid source value: must be null, undefined, or an object');
+            done();
+        });
+
+        it('throws if target is not an object', function (done) {
+
+            expect(function () {
+
+                var a = 0;
+                var b = {};
+
+                Hoek.merge(a, b);
+            }).to.throw('Invalid target value: must be an object');
+            done();
+        });
+
+        it('throws if target is not an array and source is', function (done) {
+
+            expect(function () {
+
+                var a = {};
+                var b = [1, 2];
+
+                Hoek.merge(a, b);
+            }).to.throw('Cannot merge array onto an object');
+            done();
+        });
+
+        it('returns the same object when merging arrays', function (done) {
+
+            var a = [];
+            var b = [1, 2];
+
+            expect(Hoek.merge(a, b)).to.equal(a);
+            done();
+        });
+
+        it('should combine an empty object with a non-empty object', function (done) {
+
+            var a = {};
+            var b = nestedObj;
+
+            var c = Hoek.merge(a, b);
+            expect(a).to.deep.equal(b);
+            expect(c).to.deep.equal(b);
+            done();
+        });
+
+        it('should override values in target', function (done) {
+
+            var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
+            var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
+
+            var c = Hoek.merge(a, b);
+            expect(c.x).to.equal(null);
+            expect(c.y).to.equal(2);
+            expect(c.z).to.equal(4);
+            expect(c.v).to.equal(0);
+            expect(c.m).to.equal('123');
+            expect(c.t).to.deep.equal({ u: 6 });
+            done();
+        });
+
+        it('should override values in target (flip)', function (done) {
+
+            var a = { x: 1, y: 2, z: 3, v: 5, t: 'test', m: 'abc' };
+            var b = { x: null, z: 4, v: 0, t: { u: 6 }, m: '123' };
+
+            var d = Hoek.merge(b, a);
+            expect(d.x).to.equal(1);
+            expect(d.y).to.equal(2);
+            expect(d.z).to.equal(3);
+            expect(d.v).to.equal(5);
+            expect(d.m).to.equal('abc');
+            expect(d.t).to.deep.equal('test');
+            done();
+        });
+    });
+
+    describe('#applyToDefaults', function () {
+
+        var defaults = {
+            a: 1,
+            b: 2,
+            c: {
+                d: 3,
+                e: [5, 6]
+            },
+            f: 6,
+            g: 'test'
+        };
+
+        it('should return null if options is false', function (done) {
+
+            var result = Hoek.applyToDefaults(defaults, false);
+            expect(result).to.equal(null);
+            done();
+        });
+
+        it('should return a copy of defaults if options is true', function (done) {
+
+            var result = Hoek.applyToDefaults(defaults, true);
+            expect(result).to.deep.equal(result);
+            done();
+        });
+
+        it('should apply object to defaults', function (done) {
+
+            var obj = {
+                a: null,
+                c: {
+                    e: [4]
+                },
+                f: 0,
+                g: {
+                    h: 5
+                }
+            };
+
+            var result = Hoek.applyToDefaults(defaults, obj);
+            expect(result.c.e).to.deep.equal([4]);
+            expect(result.a).to.equal(1);
+            expect(result.b).to.equal(2);
+            expect(result.f).to.equal(0);
+            expect(result.g).to.deep.equal({ h: 5 });
+            done();
+        });
+    });
+
+    describe('#unique', function () {
+
+        it('should ensure uniqueness within array of objects based on subkey', function (done) {
+
+            var a = Hoek.unique(dupsArray, 'x');
+            expect(a).to.deep.equal(reducedDupsArray);
+            done();
+        });
+
+        it('removes duplicated without key', function (done) {
+
+            expect(Hoek.unique([1, 2, 3, 4, 2, 1, 5])).to.deep.equal([1, 2, 3, 4, 5]);
+            done();
+        });
+    });
+
+    describe('#mapToObject', function () {
+
+        it('should return null on null array', function (done) {
+
+            var a = Hoek.mapToObject(null);
+            expect(a).to.equal(null);
+            done();
+        });
+
+        it('should convert basic array to existential object', function (done) {
+
+            var keys = [1, 2, 3, 4];
+            var a = Hoek.mapToObject(keys);
+            for (var i in keys) {
+                expect(a[keys[i]]).to.equal(true);
+            }
+            done();
+        });
+
+        it('should convert array of objects to existential object', function (done) {
+
+            var keys = [{ x: 1 }, { x: 2 }, { x: 3 }];
+            var subkey = 'x';
+            var a = Hoek.mapToObject(keys, subkey);
+            for (var i in keys) {
+                expect(a[keys[i][subkey]]).to.equal(true);
+            }
+            done();
+        });
+    });
+
+    describe('#intersect', function () {
+
+        it('should return the common objects of two arrays', function (done) {
+
+            var array1 = [1, 2, 3, 4, 4, 5, 5];
+            var array2 = [5, 4, 5, 6, 7];
+            var common = Hoek.intersect(array1, array2);
+            expect(common.length).to.equal(2);
+            done();
+        });
+
+        it('should return just the first common object of two arrays', function (done) {
+
+            var array1 = [1, 2, 3, 4, 4, 5, 5];
+            var array2 = [5, 4, 5, 6, 7];
+            var common = Hoek.intersect(array1, array2, true);
+            expect(common).to.equal(5);
+            done();
+        });
+
+        it('should return an empty array if either input is null', function (done) {
+
+            expect(Hoek.intersect([1], null).length).to.equal(0);
+            expect(Hoek.intersect(null, [1]).length).to.equal(0);
+            done();
+        });
+
+        it('should return the common objects of object and array', function (done) {
+
+            var array1 = [1, 2, 3, 4, 4, 5, 5];
+            var array2 = [5, 4, 5, 6, 7];
+            var common = Hoek.intersect(Hoek.mapToObject(array1), array2);
+            expect(common.length).to.equal(2);
+            done();
+        });
+    });
+
+    describe('#matchKeys', function () {
+
+        it('should match the existing object keys', function (done) {
+
+            var obj = {
+                a: 1,
+                b: 2,
+                c: 3,
+                d: null
+            };
+
+            expect(Hoek.matchKeys(obj, ['b', 'c', 'd', 'e'])).to.deep.equal(['b', 'c', 'd']);
+            done();
+        });
+    });
+
+    describe('#flatten', function () {
+
+        it('should return a flat array', function (done) {
+
+            var result = Hoek.flatten([1, 2, [3, 4, [5, 6], [7], 8], [9], [10, [11, 12]], 13]);
+            expect(result.length).to.equal(13);
+            expect(result).to.deep.equal([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]);
+            done();
+        });
+    });
+
+    describe('#removeKeys', function () {
+
+        var objWithHiddenKeys = {
+            location: {
+                name: 'San Bruno'
+            },
+            company: {
+                name: '@WalmartLabs'
+            }
+        };
+
+        it('should delete params with definition\'s hide set to true', function (done) {
+
+            var a = Hoek.removeKeys(objWithHiddenKeys, ['location']);
+            expect(objWithHiddenKeys.location).to.not.exist;
+            expect(objWithHiddenKeys.company).to.exist;
+            done();
+        });
+    });
+
+    describe('#reach', function () {
+
+        var obj = {
+            a: {
+                b: {
+                    c: {
+                        d: 1,
+                        e: 2
+                    },
+                    f: 'hello'
+                },
+                g: {
+                    h: 3
+                }
+            },
+            i: function () { }
+        };
+
+        it('returns a valid member', function (done) {
+
+            expect(Hoek.reach(obj, 'a.b.c.d')).to.equal(1);
+            done();
+        });
+
+        it('returns null on null object', function (done) {
+
+            expect(Hoek.reach(null, 'a.b.c.d')).to.not.exist;
+            done();
+        });
+
+        it('returns null on missing member', function (done) {
+
+            expect(Hoek.reach(obj, 'a.b.c.d.x')).to.not.exist;
+            done();
+        });
+
+        it('returns null on invalid member', function (done) {
+
+            expect(Hoek.reach(obj, 'a.b.c.d-.x')).to.not.exist;
+            done();
+        });
+
+        it('returns function member', function (done) {
+
+            expect(typeof Hoek.reach(obj, 'i')).to.equal('function');
+            done();
+        });
+    });
+
+    describe('#inheritAsync', function () {
+
+        it('should inherit selected methods and wrap in async call', function (done) {
+
+            var proto = {
+                a: function () {
+                    return 'a!';
+                },
+                b: function () {
+                    return 'b!';
+                },
+                c: function () {
+                    throw new Error('c!');
+                }
+            };
+
+            var targetFunc = function () { };
+            targetFunc.prototype.c = function () {
+
+                return 'oops';
+            };
+
+            Hoek.inheritAsync(targetFunc, proto, ['a', 'c']);
+            var target = new targetFunc();
+
+            expect(typeof target.a).to.equal('function');
+            expect(typeof target.c).to.equal('function');
+            expect(target.b).to.not.exist;
+
+            target.a(function (err, result) {
+
+                expect(err).to.not.exist;
+                expect(result).to.equal('a!');
+
+                target.c(function (err, result) {
+
+                    expect(result).to.not.exist;
+                    expect(err.message).to.equal('c!');
+                    done();
+                });
+            });
+        });
+    });
+
+    describe('#callStack', function () {
+
+        it('should return the full call stack', function (done) {
+
+            var stack = Hoek.callStack();
+            expect(stack[0][0]).to.contain('index.js');
+            expect(stack[0][2]).to.equal(30);
+            done();
+        });
+    });
+
+    describe('#displayStack ', function () {
+
+        it('should return the full call stack for display', function (done) {
+
+            var stack = Hoek.displayStack();
+            expect(stack[0]).to.contain('test/index.js:');
+            done();
+        });
+
+        it('should include constructor functions correctly', function (done) {
+
+            var Something = function (next) {
+
+                next();
+            };
+
+            var something = new Something(function () {
+
+                var stack = Hoek.displayStack();
+                expect(stack[1]).to.contain('new Something');
+                done();
+            });
+        });
+    });
+
+    describe('#abort', function () {
+
+        it('should exit process when not in test mode', function (done) {
+
+            var env = process.env.NODE_ENV;
+            var write = process.stdout.write;
+            var exit = process.exit;
+
+            process.env.NODE_ENV = 'nottatest';
+            process.stdout.write = function () { };
+            process.exit = function (state) {
+
+                process.exit = exit;
+                process.env.NODE_ENV = env;
+                process.stdout.write = write;
+
+                expect(state).to.equal(1);
+                done();
+            };
+
+            Hoek.abort('Boom');
+        });
+
+        it('should throw when not in test mode and abortThrow is true', function (done) {
+
+            var env = process.env.NODE_ENV;
+            process.env.NODE_ENV = 'nottatest';
+            Hoek.abortThrow = true;
+
+            var fn = function () {
+
+                Hoek.abort('my error message');
+            };
+
+            expect(fn).to.throw('my error message');
+            Hoek.abortThrow = false;
+            process.env.NODE_ENV = env;
+
+            done();
+        });
+
+
+        it('should respect hideStack argument', function (done) {
+
+            var env = process.env.NODE_ENV;
+            var write = process.stdout.write;
+            var exit = process.exit;
+            var output = '';
+
+            process.exit = function () { };
+            process.env.NODE_ENV = '';
+            process.stdout.write = function (message) {
+
+                output = message;
+            };
+
+            Hoek.abort('my error message', true);
+
+            process.env.NODE_ENV = env;
+            process.stdout.write = write;
+            process.exit = exit;
+
+            expect(output).to.equal('ABORT: my error message\n\t\n');
+
+            done();
+        });
+
+        it('should default to showing stack', function (done) {
+
+            var env = process.env.NODE_ENV;
+            var write = process.stdout.write;
+            var exit = process.exit;
+            var output = '';
+
+            process.exit = function () { };
+            process.env.NODE_ENV = '';
+            process.stdout.write = function (message) {
+
+                output = message;
+            };
+
+            Hoek.abort('my error message');
+
+            process.env.NODE_ENV = env;
+            process.stdout.write = write;
+            process.exit = exit;
+
+            expect(output).to.contain('index.js');
+
+            done();
+        });
+    });
+
+    describe('#assert', function () {
+
+        it('should throw an Error when using assert in a test', function (done) {
+
+            var fn = function () {
+
+                Hoek.assert(false, 'my error message');
+            };
+
+            expect(fn).to.throw('my error message');
+            done();
+        });
+
+        it('should throw an Error when using assert in a test with no message', function (done) {
+
+            var fn = function () {
+
+                Hoek.assert(false);
+            };
+
+            expect(fn).to.throw('Unknown error');
+            done();
+        });
+
+        it('should throw an Error when using assert in a test with multipart message', function (done) {
+
+            var fn = function () {
+
+                Hoek.assert(false, 'This', 'is', 'my message');
+            };
+
+            expect(fn).to.throw('This is my message');
+            done();
+        });
+
+        it('should throw an Error when using assert in a test with object message', function (done) {
+
+            var fn = function () {
+
+                Hoek.assert(false, 'This', 'is', { spinal: 'tap' });
+            };
+
+            expect(fn).to.throw('This is {"spinal":"tap"}');
+            done();
+        });
+
+        it('should throw an Error when using assert in a test with error object message', function (done) {
+
+            var fn = function () {
+
+                Hoek.assert(false, new Error('This is spinal tap'));
+            };
+
+            expect(fn).to.throw('This is spinal tap');
+            done();
+        });
+    });
+
+    describe('#loadDirModules', function () {
+
+        it('should load modules from directory', function (done) {
+
+            var target = {};
+            Hoek.loadDirModules(__dirname + '/modules', ['test2'], target);
+            expect(target.Test1.x).to.equal(1);
+            expect(target.Test2).to.not.exist;
+            expect(target.Test3.z).to.equal(3);
+            done();
+        });
+
+        it('should list modules from directory into function', function (done) {
+
+            var target = {};
+            Hoek.loadDirModules(__dirname + '/modules', ['test2'], function (path, name, capName) {
+
+                target[name] = capName;
+            });
+
+            expect(target.test1).to.equal('Test1');
+            expect(target.test2).to.not.exist;
+            expect(target.test3).to.equal('Test3');
+            done();
+        });
+    });
+
+    describe('#rename', function () {
+
+        it('should rename object key', function (done) {
+
+            var a = { b: 'c' };
+            Hoek.rename(a, 'b', 'x');
+            expect(a.b).to.not.exist;
+            expect(a.x).to.equal('c');
+            done();
+        });
+    });
+
+    describe('Timer', function () {
+
+        it('should return time elapsed', function (done) {
+
+            var timer = new Hoek.Timer();
+            setTimeout(function () {
+
+                expect(timer.elapsed()).to.be.above(9);
+                done();
+            }, 12);
+        });
+    });
+
+    describe('#loadPackage', function () {
+
+        it('should', function (done) {
+
+            var pack = Hoek.loadPackage();
+            expect(pack.name).to.equal('hoek');
+            done();
+        });
+    });
+
+    describe('#escapeRegex', function () {
+
+        it('should escape all special regular expression characters', function (done) {
+
+            var a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\/`"(>)[<]d{}s,');
+            expect(a).to.equal('4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`"\\(>\\)\\[<\\]d\\{\\}s\\,');
+            done();
+        });
+    });
+
+    describe('#toss', function () {
+
+        it('should call callback with new error', function (done) {
+
+            var callback = function (err) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('bug');
+                done();
+            };
+
+            Hoek.toss(true, 'feature', callback);
+            Hoek.toss(false, 'bug', callback);
+        });
+
+        it('should call callback with new error and no message', function (done) {
+
+            Hoek.toss(false, function (err) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('');
+                done();
+            });
+        });
+
+        it('should call callback with error condition', function (done) {
+
+            Hoek.toss(new Error('boom'), function (err) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('boom');
+                done();
+            });
+        });
+
+        it('should call callback with new error using message with error condition', function (done) {
+
+            Hoek.toss(new Error('ka'), 'boom', function (err) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('boom');
+                done();
+            });
+        });
+
+        it('should call callback with new error using passed error with error condition', function (done) {
+
+            Hoek.toss(new Error('ka'), new Error('boom'), function (err) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('boom');
+                done();
+            });
+        });
+    });
+
+    describe('Base64Url', function () {
+
+        var base64str = 'AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w';
+        var str = unescape('%00%01%02%03%04%05%06%07%08%09%0A%0B%0C%0D%0E%0F%10%11%12%13%14%15%16%17%18%19%1A%1B%1C%1D%1E%1F%20%21%22%23%24%25%26%27%28%29*+%2C-./0123456789%3A%3B%3C%3D%3E%3F@ABCDEFGHIJKLMNOPQRSTUVWXYZ%5B%5C%5D%5E_%60abcdefghijklmnopqrstuvwxyz%7B%7C%7D%7E%7F%80%81%82%83%84%85%86%87%88%89%8A%8B%8C%8D%8E%8F%90%91%92%93%94%95%96%97%98%99%9A%9B%9C%9D%9E%9F%A0%A1%A2%A3%A4%A5%A6%A7%A8%A9%AA%AB%AC%AD%AE%AF%B0%B1%B2%B3%B4%B5%B6%B7%B8%B9%BA%BB%BC%BD%BE%BF%C0%C1%C2%C3%C4%C5%C6%C7%C8%C9%CA%CB%CC%CD%CE%CF%D0%D1%D2%D3%D4%D5%D6%D7%D8%D9%DA%DB%DC%DD%DE%DF%E0%E1%E2%E3%E4%E5%E6%E7%E8%E9%EA%EB%EC%ED%EE%EF%F0%F1%F2%F3%F4%F5%F6%F7%F8%F9%FA%FB%FC%FD%FE%FF');
+
+        describe('#base64urlEncode', function () {
+
+            it('should base64 URL-safe a string', function (done) {
+
+                expect(Hoek.base64urlEncode(str)).to.equal(base64str);
+                done();
+            });
+        });
+
+        describe('#base64urlDecode', function () {
+
+            it('should un-base64 URL-safe a string', function (done) {
+
+                expect(Hoek.base64urlDecode(base64str)).to.equal(str);
+                done();
+            });
+
+            it('should return error on undefined input', function (done) {
+
+                expect(Hoek.base64urlDecode().message).to.exist;
+                done();
+            });
+
+            it('should return error on invalid input', function (done) {
+
+                expect(Hoek.base64urlDecode('*').message).to.exist;
+                done();
+            });
+        });
+    });
+
+    describe('#escapeHeaderAttribute', function () {
+
+        it('should not alter ascii values', function (done) {
+
+            var a = Hoek.escapeHeaderAttribute('My Value');
+            expect(a).to.equal('My Value');
+            done();
+        });
+
+        it('should escape all special HTTP header attribute characters', function (done) {
+
+            var a = Hoek.escapeHeaderAttribute('I said go!!!#"' + String.fromCharCode(92));
+            expect(a).to.equal('I said go!!!#\\"\\\\');
+            done();
+        });
+
+        it('should throw on large unicode characters', function (done) {
+
+            var fn = function () {
+
+                Hoek.escapeHeaderAttribute('this is a test' + String.fromCharCode(500) + String.fromCharCode(300));
+            };
+
+            expect(fn).to.throw(Error);
+            done();
+        });
+
+        it('should throw on CRLF to prevent response splitting', function (done) {
+
+            var fn = function () {
+
+                Hoek.escapeHeaderAttribute('this is a test\r\n');
+            };
+
+            expect(fn).to.throw(Error);
+            done();
+        });
+    });
+
+    describe('#escapeHtml', function () {
+
+        it('should escape all special HTML characters', function (done) {
+
+            var a = Hoek.escapeHtml('&<>"\'`');
+            expect(a).to.equal('&amp;&lt;&gt;&quot;&#x27;&#x60;');
+            done();
+        });
+
+        it('should return empty string on falsy input', function (done) {
+
+            var a = Hoek.escapeHtml('');
+            expect(a).to.equal('');
+            done();
+        });
+
+        it('should return unchanged string on no reserved input', function (done) {
+
+            var a = Hoek.escapeHtml('abc');
+            expect(a).to.equal('abc');
+            done();
+        });
+    });
+
+    describe('#printEvent', function () {
+
+        it('outputs event as string', function (done) {
+
+            var event = {
+                timestamp: (new Date(2013, 1, 1, 6, 30, 45, 123)).getTime(),
+                tags: ['a', 'b', 'c'],
+                data: { some: 'data' }
+            };
+
+            Hoek.consoleFunc = function (string) {
+
+                Hoek.consoleFunc = console.log;
+                expect(string).to.equal('130201/063045.123, a, {"some":"data"}');
+                done();
+            };
+
+            Hoek.printEvent(event);
+        });
+
+        it('outputs JSON error', function (done) {
+
+            var event = {
+                timestamp: (new Date(2013, 1, 1, 6, 30, 45, 123)).getTime(),
+                tags: ['a', 'b', 'c'],
+                data: { some: 'data' }
+            };
+
+            event.data.a = event.data;
+
+            Hoek.consoleFunc = function (string) {
+
+                Hoek.consoleFunc = console.log;
+                expect(string).to.equal('130201/063045.123, a, JSON Error: Converting circular structure to JSON');
+                done();
+            };
+
+            Hoek.printEvent(event);
+        });
+    });
+
+    describe('#nextTick', function () {
+
+        it('calls the provided callback on nextTick', function (done) {
+
+            var a = 0;
+
+            var inc = function (step, next) {
+
+                a += step;
+                next();
+            };
+
+            var ticked = Hoek.nextTick(inc);
+
+            ticked(5, function () {
+
+                expect(a).to.equal(6);
+                done();
+            });
+
+            expect(a).to.equal(0);
+            inc(1, function () {
+
+                expect(a).to.equal(1);
+            });
+        });
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js	(revision 487)
@@ -0,0 +1,1 @@
+exports.x = 1;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js	(revision 487)
@@ -0,0 +1,1 @@
+exports.y = 2;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js	(revision 487)
@@ -0,0 +1,1 @@
+exports.z = 3;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore	(revision 487)
@@ -0,0 +1,18 @@
+.idea
+*.iml
+npm-debug.log
+dump.rdb
+node_modules
+results.tap
+results.xml
+npm-shrinkwrap.json
+config.json
+.DS_Store
+*/.DS_Store
+*/*/.DS_Store
+._*
+*/._*
+*/*/._*
+coverage.*
+lib-cov
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml	(revision 487)
@@ -0,0 +1,5 @@
+language: node_js
+
+node_js:
+  - 0.10
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/LICENSE	(revision 487)
@@ -0,0 +1,24 @@
+Copyright (c) 2012-2013, Eran Hammer.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of Eran Hammer nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL ERAN HAMMER BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile	(revision 487)
@@ -0,0 +1,11 @@
+test:
+	@./node_modules/.bin/lab
+test-cov: 
+	@./node_modules/.bin/lab -r threshold -t 100
+test-cov-html:
+	@./node_modules/.bin/lab -r html -o coverage.html
+complexity:
+	@./node_modules/.bin/cr -o complexity.md -f markdown lib
+
+.PHONY: test test-cov test-cov-html complexity
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/README.md	(revision 487)
@@ -0,0 +1,68 @@
+# sntp
+
+An SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time
+along with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset
+to the local time.
+
+[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)
+
+# Usage
+
+```javascript
+var Sntp = require('sntp');
+
+// All options are optional
+
+var options = {
+    host: 'nist1-sj.ustiming.org',  // Defaults to pool.ntp.org
+    port: 123,                      // Defaults to 123 (NTP)
+    resolveReference: true,         // Default to false (not resolving)
+    timeout: 1000                   // Defaults to zero (no timeout)
+};
+
+// Request server time
+
+Sntp.time(options, function (err, time) {
+
+    if (err) {
+        console.log('Failed: ' + err.message);
+        process.exit(1);
+    }
+
+    console.log('Local clock is off by: ' + time.t + ' milliseconds');
+    process.exit(0);
+});
+```
+
+If an application needs to maintain continuous time synchronization, the module provides a stateful method for
+querying the current offset only when the last one is too old (defaults to daily).
+
+```javascript
+// Request offset once
+
+Sntp.offset(function (err, offset) {
+
+    console.log(offset);                    // New (served fresh)
+
+    // Request offset again
+
+    Sntp.offset(function (err, offset) {
+
+        console.log(offset);                // Identical (served from cache)
+    });
+});
+```
+
+To set a background offset refresh, start the interval and use the provided now() method. If for any reason the
+client fails to obtain an up-to-date offset, the current system clock is used.
+
+```javascript
+var before = Sntp.now();                    // System time without offset
+
+Sntp.start(function () {
+
+    var now = Sntp.now();                   // With offset
+    Sntp.stop();
+});
+```
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js	(revision 487)
@@ -0,0 +1,16 @@
+var Sntp = require('../lib');
+
+// Request offset once
+
+Sntp.offset(function (err, offset) {
+
+    console.log(offset);                    // New (served fresh)
+
+    // Request offset again
+
+    Sntp.offset(function (err, offset) {
+
+        console.log(offset);                // Identical (served from cache)
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js	(revision 487)
@@ -0,0 +1,25 @@
+var Sntp = require('../lib');
+
+// All options are optional
+
+var options = {
+    host: 'nist1-sj.ustiming.org',  // Defaults to pool.ntp.org
+    port: 123,                      // Defaults to 123 (NTP)
+    resolveReference: true,         // Default to false (not resolving)
+    timeout: 1000                   // Defaults to zero (no timeout)
+};
+
+// Request server time
+
+Sntp.time(options, function (err, time) {
+
+    if (err) {
+        console.log('Failed: ' + err.message);
+        process.exit(1);
+    }
+
+    console.log(time);
+    console.log('Local clock is off by: ' + time.t + ' milliseconds');
+    process.exit(0);
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/index.js	(revision 487)
@@ -0,0 +1,1 @@
+module.exports = require('./lib');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/lib/index.js	(revision 487)
@@ -0,0 +1,409 @@
+// Load modules
+
+var Dgram = require('dgram');
+var Dns = require('dns');
+var Hoek = require('hoek');
+
+
+// Declare internals
+
+var internals = {};
+
+
+exports.time = function (options, callback) {
+
+    if (arguments.length !== 2) {
+        callback = arguments[0];
+        options = {};
+    }
+
+    var settings = Hoek.clone(options);
+    settings.host = settings.host || 'pool.ntp.org';
+    settings.port = settings.port || 123;
+    settings.resolveReference = settings.resolveReference || false;
+
+    // Declare variables used by callback
+
+    var timeoutId = 0;
+    var sent = 0;
+
+    // Ensure callback is only called once
+
+    var isFinished = false;
+    var finish = function (err, result) {
+
+        if (timeoutId) {
+            clearTimeout(timeoutId);
+            timeoutId = 0;
+        }
+
+        if (!isFinished) {
+            isFinished = true;
+            socket.removeAllListeners();
+            socket.close();
+            return callback(err, result);
+        }
+    };
+
+    // Create UDP socket
+
+    var socket = Dgram.createSocket('udp4');
+
+    socket.once('error', function (err) {
+
+        return finish(err);
+    });
+
+    // Listen to incoming messages
+
+    socket.on('message', function (buffer, rinfo) {
+
+        var received = Date.now();
+
+        var message = new internals.NtpMessage(buffer);
+        if (!message.isValid) {
+            return finish(new Error('Invalid server response'), message);
+        }
+
+        if (message.originateTimestamp !== sent) {
+            return finish(new Error('Wrong originate timestamp'), message);
+        }
+
+        // Timestamp Name          ID   When Generated
+        // ------------------------------------------------------------
+        // Originate Timestamp     T1   time request sent by client
+        // Receive Timestamp       T2   time request received by server
+        // Transmit Timestamp      T3   time reply sent by server
+        // Destination Timestamp   T4   time reply received by client
+        //
+        // The roundtrip delay d and system clock offset t are defined as:
+        //
+        // d = (T4 - T1) - (T3 - T2)     t = ((T2 - T1) + (T3 - T4)) / 2
+
+        var T1 = message.originateTimestamp;
+        var T2 = message.receiveTimestamp;
+        var T3 = message.transmitTimestamp;
+        var T4 = received;
+
+        message.d = (T4 - T1) - (T3 - T2);
+        message.t = ((T2 - T1) + (T3 - T4)) / 2;
+        message.receivedLocally = received;
+
+        if (!settings.resolveReference ||
+            message.stratum !== 'secondary') {
+
+            return finish(null, message);
+        }
+
+        // Resolve reference IP address
+
+        Dns.reverse(message.referenceId, function (err, domains) {
+
+            if (!err) {
+                message.referenceHost = domains[0];
+            }
+
+            return finish(null, message);
+        });
+    });
+
+    // Set timeout
+
+    if (settings.timeout) {
+        timeoutId = setTimeout(function () {
+
+            timeoutId = 0;
+            return finish(new Error('Timeout'));
+        }, settings.timeout);
+    }
+
+    // Construct NTP message
+
+    var message = new Buffer(48);
+    for (var i = 0; i < 48; i++) {                      // Zero message
+        message[i] = 0;
+    }
+
+    message[0] = (0 << 6) + (4 << 3) + (3 << 0)         // Set version number to 4 and Mode to 3 (client)
+    sent = Date.now();
+    internals.fromMsecs(sent, message, 40);               // Set transmit timestamp (returns as originate)
+
+    // Send NTP request
+
+    socket.send(message, 0, message.length, settings.port, settings.host, function (err, bytes) {
+
+        if (err ||
+            bytes !== 48) {
+
+            return finish(err || new Error('Could not send entire message'));
+        }
+    });
+};
+
+
+internals.NtpMessage = function (buffer) {
+
+    this.isValid = false;
+
+    // Validate
+
+    if (buffer.length !== 48) {
+        return;
+    }
+
+    // Leap indicator
+
+    var li = (buffer[0] >> 6);
+    switch (li) {
+        case 0: this.leapIndicator = 'no-warning'; break;
+        case 1: this.leapIndicator = 'last-minute-61'; break;
+        case 2: this.leapIndicator = 'last-minute-59'; break;
+        case 3: this.leapIndicator = 'alarm'; break;
+    }
+
+    // Version
+
+    var vn = ((buffer[0] & 0x38) >> 3);
+    this.version = vn;
+
+    // Mode
+
+    var mode = (buffer[0] & 0x7);
+    switch (mode) {
+        case 1: this.mode = 'symmetric-active'; break;
+        case 2: this.mode = 'symmetric-passive'; break;
+        case 3: this.mode = 'client'; break;
+        case 4: this.mode = 'server'; break;
+        case 5: this.mode = 'broadcast'; break;
+        case 0:
+        case 6:
+        case 7: this.mode = 'reserved'; break;
+    }
+
+    // Stratum
+
+    var stratum = buffer[1];
+    if (stratum === 0) {
+        this.stratum = 'death';
+    }
+    else if (stratum === 1) {
+        this.stratum = 'primary';
+    }
+    else if (stratum <= 15) {
+        this.stratum = 'secondary';
+    }
+    else {
+        this.stratum = 'reserved';
+    }
+
+    // Poll interval (msec)
+
+    this.pollInterval = Math.round(Math.pow(2, buffer[2])) * 1000;
+
+    // Precision (msecs)
+
+    this.precision = Math.pow(2, buffer[3]) * 1000;
+
+    // Root delay (msecs)
+
+    var rootDelay = 256 * (256 * (256 * buffer[4] + buffer[5]) + buffer[6]) + buffer[7];
+    this.rootDelay = 1000 * (rootDelay / 0x10000);
+
+    // Root dispersion (msecs)
+
+    this.rootDispersion = ((buffer[8] << 8) + buffer[9] + ((buffer[10] << 8) + buffer[11]) / Math.pow(2, 16)) * 1000;
+
+    // Reference identifier
+
+    this.referenceId = '';
+    switch (this.stratum) {
+        case 'death':
+        case 'primary':
+            this.referenceId = String.fromCharCode(buffer[12]) + String.fromCharCode(buffer[13]) + String.fromCharCode(buffer[14]) + String.fromCharCode(buffer[15]);
+            break;
+        case 'secondary':
+            this.referenceId = '' + buffer[12] + '.' + buffer[13] + '.' + buffer[14] + '.' + buffer[15];
+            break;
+    }
+
+    // Reference timestamp
+
+    this.referenceTimestamp = internals.toMsecs(buffer, 16);
+
+    // Originate timestamp
+
+    this.originateTimestamp = internals.toMsecs(buffer, 24);
+
+    // Receive timestamp
+
+    this.receiveTimestamp = internals.toMsecs(buffer, 32);
+
+    // Transmit timestamp
+
+    this.transmitTimestamp = internals.toMsecs(buffer, 40);
+
+    // Validate
+
+    if (this.version === 4 &&
+        this.stratum !== 'reserved' &&
+        this.mode === 'server' &&
+        this.originateTimestamp &&
+        this.receiveTimestamp &&
+        this.transmitTimestamp) {
+
+        this.isValid = true;
+    }
+
+    return this;
+};
+
+
+internals.toMsecs = function (buffer, offset) {
+
+    var seconds = 0;
+    var fraction = 0;
+
+    for (var i = 0; i < 4; ++i) {
+        seconds = (seconds * 256) + buffer[offset + i];
+    }
+
+    for (i = 4; i < 8; ++i) {
+        fraction = (fraction * 256) + buffer[offset + i];
+    }
+
+    return ((seconds - 2208988800 + (fraction / Math.pow(2, 32))) * 1000);
+};
+
+
+internals.fromMsecs = function (ts, buffer, offset) {
+
+    var seconds = Math.floor(ts / 1000) + 2208988800;
+    var fraction = Math.round((ts % 1000) / 1000 * Math.pow(2, 32));
+
+    buffer[offset + 0] = (seconds & 0xFF000000) >> 24;
+    buffer[offset + 1] = (seconds & 0x00FF0000) >> 16;
+    buffer[offset + 2] = (seconds & 0x0000FF00) >> 8;
+    buffer[offset + 3] = (seconds & 0x000000FF);
+
+    buffer[offset + 4] = (fraction & 0xFF000000) >> 24;
+    buffer[offset + 5] = (fraction & 0x00FF0000) >> 16;
+    buffer[offset + 6] = (fraction & 0x0000FF00) >> 8;
+    buffer[offset + 7] = (fraction & 0x000000FF);
+};
+
+
+// Offset singleton
+
+internals.last = {
+    offset: 0,
+    expires: 0,
+    host: '',
+    port: 0
+};
+
+
+exports.offset = function (options, callback) {
+
+    if (arguments.length !== 2) {
+        callback = arguments[0];
+        options = {};
+    }
+
+    var now = Date.now();
+    var clockSyncRefresh = options.clockSyncRefresh || 24 * 60 * 60 * 1000;                    // Daily
+
+    if (internals.last.offset &&
+        internals.last.host === options.host &&
+        internals.last.port === options.port &&
+        now < internals.last.expires) {
+
+        process.nextTick(function () {
+                
+            callback(null, internals.last.offset);
+        });
+
+        return;
+    }
+
+    exports.time(options, function (err, time) {
+
+        if (err) {
+            return callback(err, 0);
+        }
+
+        internals.last = {
+            offset: Math.round(time.t),
+            expires: now + clockSyncRefresh,
+            host: options.host,
+            port: options.port
+        };
+
+        return callback(null, internals.last.offset);
+    });
+};
+
+
+// Now singleton
+
+internals.now = {
+    intervalId: 0
+};
+
+
+exports.start = function (options, callback) {
+
+    if (arguments.length !== 2) {
+        callback = arguments[0];
+        options = {};
+    }
+
+    if (internals.now.intervalId) {
+        process.nextTick(function () {
+            
+            callback();
+        });
+        
+        return;
+    }
+
+    exports.offset(options, function (err, offset) {
+
+        internals.now.intervalId = setInterval(function () {
+
+            exports.offset(options, function () { });
+        }, options.clockSyncRefresh || 24 * 60 * 60 * 1000);                                // Daily
+
+        return callback();
+    });
+};
+
+
+exports.stop = function () {
+
+    if (!internals.now.intervalId) {
+        return;
+    }
+
+    clearInterval(internals.now.intervalId);
+    internals.now.intervalId = 0;
+};
+
+
+exports.isLive = function () {
+
+    return !!internals.now.intervalId;
+};
+
+
+exports.now = function () {
+
+    var now = Date.now();
+    if (!exports.isLive() ||
+        now >= internals.last.expires) {
+
+        return now;
+    }
+
+    return now + internals.last.offset;
+};
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/package.json	(revision 487)
@@ -0,0 +1,48 @@
+{
+  "name": "sntp",
+  "description": "SNTP Client",
+  "version": "0.2.4",
+  "author": {
+    "name": "Eran Hammer",
+    "email": "eran@hueniverse.com",
+    "url": "http://hueniverse.com"
+  },
+  "contributors": [],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/hueniverse/sntp"
+  },
+  "main": "index",
+  "keywords": [
+    "sntp",
+    "ntp",
+    "time"
+  ],
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "dependencies": {
+    "hoek": "0.9.x"
+  },
+  "devDependencies": {
+    "lab": "0.1.x",
+    "complexity-report": "0.x.x"
+  },
+  "scripts": {
+    "test": "make test-cov"
+  },
+  "licenses": [
+    {
+      "type": "BSD",
+      "url": "http://github.com/hueniverse/sntp/raw/master/LICENSE"
+    }
+  ],
+  "readme": "# sntp\n\nAn SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time\nalong with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset\nto the local time.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)\n\n# Usage\n\n```javascript\nvar Sntp = require('sntp');\n\n// All options are optional\n\nvar options = {\n    host: 'nist1-sj.ustiming.org',  // Defaults to pool.ntp.org\n    port: 123,                      // Defaults to 123 (NTP)\n    resolveReference: true,         // Default to false (not resolving)\n    timeout: 1000                   // Defaults to zero (no timeout)\n};\n\n// Request server time\n\nSntp.time(options, function (err, time) {\n\n    if (err) {\n        console.log('Failed: ' + err.message);\n        process.exit(1);\n    }\n\n    console.log('Local clock is off by: ' + time.t + ' milliseconds');\n    process.exit(0);\n});\n```\n\nIf an application needs to maintain continuous time synchronization, the module provides a stateful method for\nquerying the current offset only when the last one is too old (defaults to daily).\n\n```javascript\n// Request offset once\n\nSntp.offset(function (err, offset) {\n\n    console.log(offset);                    // New (served fresh)\n\n    // Request offset again\n\n    Sntp.offset(function (err, offset) {\n\n        console.log(offset);                // Identical (served from cache)\n    });\n});\n```\n\nTo set a background offset refresh, start the interval and use the provided now() method. If for any reason the\nclient fails to obtain an up-to-date offset, the current system clock is used.\n\n```javascript\nvar before = Sntp.now();                    // System time without offset\n\nSntp.start(function () {\n\n    var now = Sntp.now();                   // With offset\n    Sntp.stop();\n});\n```\n\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/hueniverse/sntp/issues"
+  },
+  "homepage": "https://github.com/hueniverse/sntp",
+  "_id": "sntp@0.2.4",
+  "_from": "sntp@0.2.x"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js	(revision 487)
@@ -0,0 +1,359 @@
+// Load modules
+
+var Dgram = require('dgram');
+var Lab = require('lab');
+var Sntp = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('SNTP', function () {
+
+    describe('#time', function () {
+
+        it('returns consistent result over multiple tries', function (done) {
+
+            Sntp.time(function (err, time) {
+
+                expect(err).to.not.exist;
+                expect(time).to.exist;
+                var t1 = time.t;
+
+                Sntp.time(function (err, time) {
+
+                    expect(err).to.not.exist;
+                    expect(time).to.exist;
+                    var t2 = time.t;
+                    expect(Math.abs(t1 - t2)).is.below(200);
+                    done();
+                });
+            });
+        });
+
+        it('resolves reference IP', function (done) {
+
+            Sntp.time({ host: 'ntp.exnet.com', resolveReference: true }, function (err, time) {
+
+                expect(err).to.not.exist;
+                expect(time).to.exist;
+                expect(time.referenceHost).to.exist;
+                done();
+            });
+        });
+
+        it('times out on no response', function (done) {
+
+            Sntp.time({ port: 124, timeout: 100 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time).to.not.exist;
+                expect(err.message).to.equal('Timeout');
+                done();
+            });
+        });
+
+        it('errors on error event', function (done) {
+
+            var orig = Dgram.createSocket;
+            Dgram.createSocket = function (type) {
+
+                Dgram.createSocket = orig;
+                var socket = Dgram.createSocket(type);
+                process.nextTick(function () { socket.emit('error', new Error('Fake')) });
+                return socket;
+            };
+
+            Sntp.time(function (err, time) {
+
+                expect(err).to.exist;
+                expect(time).to.not.exist;
+                expect(err.message).to.equal('Fake');
+                done();
+            });
+        });
+
+        it('times out on invalid host', function (done) {
+
+            Sntp.time({ host: 'error', timeout: 10000 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time).to.not.exist;
+                expect(err.message).to.equal('getaddrinfo ENOTFOUND');
+                done();
+            });
+        });
+
+        it('fails on bad response buffer size', function (done) {
+
+            var server = Dgram.createSocket('udp4');
+            server.on('message', function (message, remote) {
+                var message = new Buffer(10);
+                server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
+
+                    server.close();
+                });
+            });
+
+            server.bind(49123);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Invalid server response');
+                done();
+            });
+        });
+
+        var messup = function (bytes) {
+
+            var server = Dgram.createSocket('udp4');
+            server.on('message', function (message, remote) {
+
+                var message = new Buffer([
+                    0x24, 0x01, 0x00, 0xe3,
+                    0x00, 0x00, 0x00, 0x00,
+                    0x00, 0x00, 0x00, 0x00,
+                    0x41, 0x43, 0x54, 0x53,
+                    0xd4, 0xa8, 0x2d, 0xc7,
+                    0x1c, 0x5d, 0x49, 0x1b,
+                    0xd4, 0xa8, 0x2d, 0xe6,
+                    0x67, 0xef, 0x9d, 0xb2,
+                    0xd4, 0xa8, 0x2d, 0xe6,
+                    0x71, 0xed, 0xb5, 0xfb,
+                    0xd4, 0xa8, 0x2d, 0xe6,
+                    0x71, 0xee, 0x6c, 0xc5
+                ]);
+
+                for (var i = 0, il = bytes.length; i < il; ++i) {
+                    message[bytes[i][0]] = bytes[i][1];
+                }
+
+                server.send(message, 0, message.length, remote.port, remote.address, function (err, bytes) {
+
+                    server.close();
+                });
+            });
+
+            server.bind(49123);
+        };
+
+        it('fails on bad version', function (done) {
+
+            messup([[0, (0 << 6) + (3 << 3) + (4 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time.version).to.equal(3);
+                expect(err.message).to.equal('Invalid server response');
+                done();
+            });
+        });
+
+        it('fails on bad originate timestamp and alarm li', function (done) {
+
+            messup([[0, (3 << 6) + (4 << 3) + (4 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Wrong originate timestamp');
+                expect(time.leapIndicator).to.equal('alarm');
+                done();
+            });
+        });
+
+        it('returns time with death stratum and last61 li', function (done) {
+
+            messup([[0, (1 << 6) + (4 << 3) + (4 << 0)], [1, 0]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(time.stratum).to.equal('death');
+                expect(time.leapIndicator).to.equal('last-minute-61');
+                done();
+            });
+        });
+
+        it('returns time with reserved stratum and last59 li', function (done) {
+
+            messup([[0, (2 << 6) + (4 << 3) + (4 << 0)], [1, 0x1f]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(time.stratum).to.equal('reserved');
+                expect(time.leapIndicator).to.equal('last-minute-59');
+                done();
+            });
+        });
+
+        it('fails on bad mode (symmetric-active)', function (done) {
+
+            messup([[0, (0 << 6) + (4 << 3) + (1 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time.mode).to.equal('symmetric-active');
+                done();
+            });
+        });
+
+        it('fails on bad mode (symmetric-passive)', function (done) {
+
+            messup([[0, (0 << 6) + (4 << 3) + (2 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time.mode).to.equal('symmetric-passive');
+                done();
+            });
+        });
+
+        it('fails on bad mode (client)', function (done) {
+
+            messup([[0, (0 << 6) + (4 << 3) + (3 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time.mode).to.equal('client');
+                done();
+            });
+        });
+
+        it('fails on bad mode (broadcast)', function (done) {
+
+            messup([[0, (0 << 6) + (4 << 3) + (5 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time.mode).to.equal('broadcast');
+                done();
+            });
+        });
+
+        it('fails on bad mode (reserved)', function (done) {
+
+            messup([[0, (0 << 6) + (4 << 3) + (6 << 0)]]);
+
+            Sntp.time({ host: 'localhost', port: 49123 }, function (err, time) {
+
+                expect(err).to.exist;
+                expect(time.mode).to.equal('reserved');
+                done();
+            });
+        });
+    });
+
+    describe('#offset', function () {
+
+        it('gets the current offset', function (done) {
+
+            Sntp.offset(function (err, offset) {
+
+                expect(err).to.not.exist;
+                expect(offset).to.not.equal(0);
+                done();
+            });
+        });
+
+        it('gets the current offset from cache', function (done) {
+
+            Sntp.offset(function (err, offset) {
+
+                expect(err).to.not.exist;
+                expect(offset).to.not.equal(0);
+                var offset1 = offset;
+                Sntp.offset({}, function (err, offset) {
+
+                    expect(err).to.not.exist;
+                    expect(offset).to.equal(offset1);
+                    done();
+                });
+            });
+        });
+
+        it('fails getting the current offset on invalid server', function (done) {
+
+            Sntp.offset({ host: 'error' }, function (err, offset) {
+
+                expect(err).to.exist;
+                expect(offset).to.equal(0);
+                done();
+            });
+        });
+    });
+
+    describe('#now', function () {
+
+        it('starts auto-sync, gets now, then stops', function (done) {
+
+            Sntp.stop();
+
+            var before = Sntp.now();
+            expect(before).to.equal(Date.now());
+
+            Sntp.start(function () {
+
+                var now = Sntp.now();
+                expect(now).to.not.equal(Date.now());
+                Sntp.stop();
+
+                done();
+            });
+        });
+
+        it('starts twice', function (done) {
+
+            Sntp.start(function () {
+
+                Sntp.start(function () {
+
+                    var now = Sntp.now();
+                    expect(now).to.not.equal(Date.now());
+                    Sntp.stop();
+
+                    done();
+                });
+            });
+        });
+
+        it('starts auto-sync, gets now, waits, gets again after timeout', function (done) {
+
+            Sntp.stop();
+
+            var before = Sntp.now();
+            expect(before).to.equal(Date.now());
+
+            Sntp.start({ clockSyncRefresh: 100 }, function () {
+
+                var now = Sntp.now();
+                expect(now).to.not.equal(Date.now());
+                expect(now).to.equal(Sntp.now());
+
+                setTimeout(function () {
+
+                    expect(Sntp.now()).to.not.equal(now);
+                    Sntp.stop();
+                    done();
+                }, 110);
+            });
+        });
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/package.json	(revision 487)
@@ -0,0 +1,53 @@
+{
+  "name": "hawk",
+  "description": "HTTP Hawk Authentication Scheme",
+  "version": "1.0.0",
+  "author": {
+    "name": "Eran Hammer",
+    "email": "eran@hueniverse.com",
+    "url": "http://hueniverse.com"
+  },
+  "contributors": [],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/hueniverse/hawk"
+  },
+  "main": "index",
+  "keywords": [
+    "http",
+    "authentication",
+    "scheme",
+    "hawk"
+  ],
+  "engines": {
+    "node": ">=0.8.0"
+  },
+  "dependencies": {
+    "hoek": "0.9.x",
+    "boom": "0.4.x",
+    "cryptiles": "0.2.x",
+    "sntp": "0.2.x"
+  },
+  "devDependencies": {
+    "lab": "0.1.x",
+    "complexity-report": "0.x.x",
+    "localStorage": "1.0.x"
+  },
+  "scripts": {
+    "test": "make test-cov"
+  },
+  "licenses": [
+    {
+      "type": "BSD",
+      "url": "http://github.com/hueniverse/hawk/raw/master/LICENSE"
+    }
+  ],
+  "readme": "![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png)\n\n<img align=\"right\" src=\"https://raw.github.com/hueniverse/hawk/master/images/logo.png\" /> **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial\nHTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz).\n\nCurrent version: **1.0**\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk)\n\n# Table of Content\n\n- [**Introduction**](#introduction)\n  - [Replay Protection](#replay-protection)\n  - [Usage Example](#usage-example)\n  - [Protocol Example](#protocol-example)\n    - [Payload Validation](#payload-validation)\n    - [Response Payload Validation](#response-payload-validation)\n  - [Browser Support and Considerations](#browser-support-and-considerations)\n<p></p>\n- [**Single URI Authorization**](#single-uri-authorization)\n  - [Usage Example](#bewit-usage-example)\n<p></p>\n- [**Security Considerations**](#security-considerations)\n  - [MAC Keys Transmission](#mac-keys-transmission)\n  - [Confidentiality of Requests](#confidentiality-of-requests)\n  - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers)\n  - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials)\n  - [Entropy of Keys](#entropy-of-keys)\n  - [Coverage Limitations](#coverage-limitations)\n  - [Future Time Manipulation](#future-time-manipulation)\n  - [Client Clock Poisoning](#client-clock-poisoning)\n  - [Bewit Limitations](#bewit-limitations)\n  - [Host Header Forgery](#host-header-forgery)\n<p></p>\n- [**Frequently Asked Questions**](#frequently-asked-questions)\n<p></p>\n- [**Acknowledgements**](#acknowledgements)\n\n# Introduction\n\n**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with\npartial cryptographic verification of the request and response, covering the HTTP method, request URI, host,\nand optionally the request payload.\n\nSimilar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of\nclient credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme,\nthe key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is\nincluded in its place.\n\nHowever, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of\nreplay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less\n\"chattiness\" (interaction with the server).\n\nAlso unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because\nthe client and server must both have access to the key material in the clear.\n\nThe primary design goals of this scheme are to:\n* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources,\n* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where\n  to send an authenticated request), and\n* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client\n  failure to validate the server's identity as part of its TLS handshake.\n\nIn addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using\na query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk).\n\nThe **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server,\nwhich is beyond the scope of this module. Typically, the shared credentials are established via an initial\nTLS-protected phase or derived from some other shared confidential information available to both the client\nand the server.\n\n\n## Replay Protection\n\nWithout replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more \nthan once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when \nmaking requests. This gives the server enough information to prevent replay attacks.\n\nThe nonce is generated by the client, and is a string unique across all requests with the same timestamp and\nkey identifier combination. \n\nThe timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards\nare rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.\nBy default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in\npractice translates to a maximum of 2 minutes as the skew can be positive or negative).\n\nUsing a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client\nclock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types\n(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response\nto a bad timestamp.\n\nThere is no expectation that the client will adjust its system clock to match the server (in fact, this would be a\npotential attack vector). Instead, the client only uses the server's time to calculate an offset used only\nfor communications with that particular server. The protocol rewards clients with synchronized clocks by reducing\nthe number of round trips required to authenticate the first request.\n\n\n## Usage Example\n\nServer code:\n\n```javascript\nvar Http = require('http');\nvar Hawk = require('hawk');\n\n\n// Credentials lookup function\n\nvar credentialsFunc = function (id, callback) {\n\n    var credentials = {\n        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n        algorithm: 'sha256',\n        user: 'Steve'\n    };\n\n    return callback(null, credentials);\n};\n\n// Create HTTP server\n\nvar handler = function (req, res) {\n\n    // Authenticate incoming request\n\n    Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {\n\n        // Prepare response\n\n        var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');\n        var headers = { 'Content-Type': 'text/plain' };\n\n        // Generate Server-Authorization response header\n\n        var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] });\n        headers['Server-Authorization'] = header;\n\n        // Send the response back\n\n        res.writeHead(!err ? 200 : 401, headers);\n        res.end(payload);\n    });\n};\n\n// Start server\n\nHttp.createServer(handler).listen(8000, 'example.com');\n```\n\nClient code:\n\n```javascript\nvar Request = require('request');\nvar Hawk = require('hawk');\n\n\n// Client credentials\n\nvar credentials = {\n    id: 'dh37fgj492je',\n    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n    algorithm: 'sha256'\n}\n\n// Request options\n\nvar requestOptions = {\n    uri: 'http://example.com:8000/resource/1?b=1&a=2',\n    method: 'GET',\n    headers: {}\n};\n\n// Generate Authorization request header\n\nvar header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' });\nrequestOptions.headers.Authorization = header.field;\n\n// Send authenticated request\n\nRequest(requestOptions, function (error, response, body) {\n\n    // Authenticate the server's response\n\n    var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });\n\n    // Output results\n\n    console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));\n});\n```\n\n**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local\nmachine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method.\n\n```javascript\nHawk.sntp.start();\n```\n\n\n## Protocol Example\n\nThe client attempts to access a protected resource without authentication, sending the following HTTP request to\nthe resource server:\n\n```\nGET /resource/1?b=1&a=2 HTTP/1.1\nHost: example.com:8000\n```\n\nThe resource server returns an authentication challenge.\n\n```\nHTTP/1.1 401 Unauthorized\nWWW-Authenticate: Hawk\n```\n\nThe client has previously obtained a set of **Hawk** credentials for accessing resources on the \"http://example.com/\"\nserver. The **Hawk** credentials issued to the client include the following attributes:\n\n* Key identifier: dh37fgj492je\n* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn\n* Algorithm: sha256\n\nThe client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1,\n1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline\ncharacter):\n\n```\nhawk.1.header\n1353832234\nj4h3g2\nGET\n/resource/1?b=1&a=2\nexample.com\n8000\n\nsome-app-ext-data\n\n```\n\nThe request MAC is calculated using HMAC with the specified hash algorithm \"sha256\" and the key over the normalized request string.\nThe result is base64-encoded to produce the request MAC:\n\n```\n6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=\n```\n\nThe client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using\nthe HTTP `Authorization` request header field:\n\n```\nGET /resource/1?b=1&a=2 HTTP/1.1\nHost: example.com:8000\nAuthorization: Hawk id=\"dh37fgj492je\", ts=\"1353832234\", nonce=\"j4h3g2\", ext=\"some-app-ext-data\", mac=\"6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=\"\n```\n\nThe server validates the request by calculating the request MAC again based on the request received and verifies the validity\nand scope of the **Hawk** credentials. If valid, the server responds with the requested resource.\n\n\n### Payload Validation\n\n**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash\nusing the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character):\n* `hawk.1.payload`\n* the content-type in lowercase, without any parameters (e.g. `application/json`)\n* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability)\n\nFor example:\n\n* Payload: `Thank you for flying Hawk`\n* Content Type: `text/plain`\n* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=`\n\nResults in the following input to the payload hash function (newline terminated values):\n\n```\nhawk.1.payload\ntext/plain\nThank you for flying Hawk\n\n```\n\nWhich produces the following hash value:\n\n```\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\n```\n\nThe client constructs the normalized request string (newline terminated values):\n\n```\nhawk.1.header\n1353832234\nj4h3g2\nPOST\n/resource/1?a=1&b=2\nexample.com\n8000\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\nsome-app-ext-data\n\n```\n\nThen calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data,\nand request MAC, with the request using the HTTP `Authorization` request header field:\n\n```\nPOST /resource/1?a=1&b=2 HTTP/1.1\nHost: example.com:8000\nAuthorization: Hawk id=\"dh37fgj492je\", ts=\"1353832234\", nonce=\"j4h3g2\", hash=\"Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\", ext=\"some-app-ext-data\", mac=\"aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=\"\n```\n\nIt is up to the server if and when it validates the payload for any given request, based solely on it's security policy\nand the nature of the data included.\n\nIf the payload is available at the time of authentication, the server uses the hash value provided by the client to construct\nthe normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value\nwith the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash.\n\nHowever, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed\nat a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value\nprovided by the client after validating the MAC.\n\nIt is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value\nincluded in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided\nby the client, the payload may be modified by an attacker.\n\n\n## Response Payload Validation\n\n**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the\nclient to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header\nas a response header using the exact same syntax as the `Authorization` request header field.\n\nThe header is contructed using the same process as the client's request header. The server uses the same credentials and other\nartifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with\nnew values based on the server response. The rest as identical to those used by the client.\n\nThe result MAC digest is included with the optional `hash` and `ext` values:\n\n```\nServer-Authorization: Hawk mac=\"XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"\n```\n\n\n## Browser Support and Considerations\n\nA browser script is provided for including using a `<script>` tag in [lib/browser.js](/lib/browser.js).\n\n**Hawk** relies on the _Server-Authorization_ and _WWW-Authenticate_ headers in its response to communicate with the client.\nTherefore, in case of CORS requests, it is important to consider sending _Access-Control-Expose-Headers_ with the value\n_\"WWW-Authenticate, Server-Authorization\"_ on each response from your server. As explained in the\n[specifications](http://www.w3.org/TR/cors/#access-control-expose-headers-response-header), it will indicate that these headers\ncan safely be accessed by the client (using getResponseHeader() on the XmlHttpRequest object). Otherwise you will be met with a\n[\"simple response header\"](http://www.w3.org/TR/cors/#simple-response-header) which excludes these fields and would prevent the\nHawk client from authenticating the requests.You can read more about the why and how in this\n[article](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)\n\n\n# Single URI Authorization\n\nThere are cases in which limited and short-term access to a protected resource is granted to a third party which does not\nhave access to the shared credentials. For example, displaying a protected image on a web page accessed by anyone. **Hawk**\nprovides limited support for such URIs in the form of a _bewit_ - a URI query parameter appended to the request URI which contains\nthe necessary credentials to authenticate the request.\n\nBecause of the significant security risks involved in issuing such access, bewit usage is purposely limited only to GET requests\nand for a finite period of time. Both the client and server can issue bewit credentials, however, the server should not use the same\ncredentials as the client to maintain clear traceability as to who issued which credentials.\n\nIn order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within\nthe granted access timeframe. \n\n\n## Bewit Usage Example\n\nServer code:\n\n```javascript\nvar Http = require('http');\nvar Hawk = require('hawk');\n\n\n// Credentials lookup function\n\nvar credentialsFunc = function (id, callback) {\n\n    var credentials = {\n        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n        algorithm: 'sha256'\n    };\n\n    return callback(null, credentials);\n};\n\n// Create HTTP server\n\nvar handler = function (req, res) {\n\n    Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {\n\n        res.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' });\n        res.end(!err ? 'Access granted' : 'Shoosh!');\n    });\n};\n\nHttp.createServer(handler).listen(8000, 'example.com');\n```\n\nBewit code generation:\n\n```javascript\nvar Request = require('request');\nvar Hawk = require('hawk');\n\n\n// Client credentials\n\nvar credentials = {\n    id: 'dh37fgj492je',\n    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n    algorithm: 'sha256'\n}\n\n// Generate bewit\n\nvar duration = 60 * 5;      // 5 Minutes\nvar bewit = Hawk.uri.getBewit('http://example.com:8080/resource/1?b=1&a=2', { credentials: credentials, ttlSec: duration, ext: 'some-app-data' });\nvar uri = 'http://example.com:8000/resource/1?b=1&a=2' + '&bewit=' + bewit;\n```\n\n\n# Security Considerations\n\nThe greatest sources of security risks are usually found not in **Hawk** but in the policies and procedures surrounding its use.\nImplementers are strongly encouraged to assess how this module addresses their security requirements. This section includes\nan incomplete list of security considerations that must be reviewed and understood before deploying **Hawk** on the server.\nMany of the protections provided in **Hawk** depends on whether and how they are used.\n\n### MAC Keys Transmission\n\n**Hawk** does not provide any mechanism for obtaining or transmitting the set of shared credentials required. Any mechanism used\nto obtain **Hawk** credentials must ensure that these transmissions are protected using transport-layer mechanisms such as TLS.\n\n### Confidentiality of Requests\n\nWhile **Hawk** provides a mechanism for verifying the integrity of HTTP requests, it provides no guarantee of request\nconfidentiality. Unless other precautions are taken, eavesdroppers will have full access to the request content. Servers should\ncarefully consider the types of data likely to be sent as part of such requests, and employ transport-layer security mechanisms\nto protect sensitive resources.\n\n### Spoofing by Counterfeit Servers\n\n**Hawk** provides limited verification of the server authenticity. When receiving a response back from the server, the server\nmay choose to include a response `Server-Authorization` header which the client can use to verify the response. However, it is up to\nthe server to determine when such measure is included, to up to the client to enforce that policy.\n\nA hostile party could take advantage of this by intercepting the client's requests and returning misleading or otherwise\nincorrect responses. Service providers should consider such attacks when developing services using this protocol, and should\nrequire transport-layer security for any requests where the authenticity of the resource server or of server responses is an issue.\n\n### Plaintext Storage of Credentials\n\nThe **Hawk** key functions the same way passwords do in traditional authentication systems. In order to compute the request MAC,\nthe server must have access to the key in plaintext form. This is in contrast, for example, to modern operating systems, which\nstore only a one-way hash of user credentials.\n\nIf an attacker were to gain access to these keys - or worse, to the server's database of all such keys - he or she would be able\nto perform any action on behalf of any resource owner. Accordingly, it is critical that servers protect these keys from unauthorized\naccess.\n\n### Entropy of Keys\n\nUnless a transport-layer security protocol is used, eavesdroppers will have full access to authenticated requests and request\nMAC values, and will thus be able to mount offline brute-force attacks to recover the key used. Servers should be careful to\nassign keys which are long enough, and random enough, to resist such attacks for at least the length of time that the **Hawk**\ncredentials are valid.\n\nFor example, if the credentials are valid for two weeks, servers should ensure that it is not possible to mount a brute force\nattack that recovers the key in less than two weeks. Of course, servers are urged to err on the side of caution, and use the\nlongest key reasonable.\n\nIt is equally important that the pseudo-random number generator (PRNG) used to generate these keys be of sufficiently high\nquality. Many PRNG implementations generate number sequences that may appear to be random, but which nevertheless exhibit\npatterns or other weaknesses which make cryptanalysis or brute force attacks easier. Implementers should be careful to use\ncryptographically secure PRNGs to avoid these problems.\n\n### Coverage Limitations\n\nThe request MAC only covers the HTTP `Host` header and optionally the `Content-Type` header. It does not cover any other headers\nwhich can often affect how the request body is interpreted by the server. If the server behavior is influenced by the presence\nor value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the\n`ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.\n\nThe response authentication, when performed, only covers the response payload, content-type, and the request information \nprovided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or\nany other response header field (e.g. Location) which can affect the client's behaviour.\n\n### Future Time Manipulation\n\nThe protocol relies on a clock sync between the client and server. To accomplish this, the server informs the client of its\ncurrent time when an invalid timestamp is received.\n\nIf an attacker is able to manipulate this information and cause the client to use an incorrect time, it would be able to cause\nthe client to generate authenticated requests using time in the future. Such requests will fail when sent by the client, and will\nnot likely leave a trace on the server (given the common implementation of nonce, if at all enforced). The attacker will then\nbe able to replay the request at the correct time without detection.\n\nThe client must only use the time information provided by the server if:\n* it was delivered over a TLS connection and the server identity has been verified, or\n* the `tsm` MAC digest calculated using the same client credentials over the timestamp has been verified.\n\n### Client Clock Poisoning\n\nWhen receiving a request with a bad timestamp, the server provides the client with its current time. The client must never use\nthe time received from the server to adjust its own clock, and must only use it to calculate an offset for communicating with\nthat particular server.\n\n### Bewit Limitations\n\nSpecial care must be taken when issuing bewit credentials to third parties. Bewit credentials are valid until expiration and cannot\nbe revoked or limited without using other means. Whatever resource they grant access to will be completely exposed to anyone with\naccess to the bewit credentials which act as bearer credentials for that particular resource. While bewit usage is limited to GET\nrequests only and therefore cannot be used to perform transactions or change server state, it can still be used to expose private\nand sensitive information.\n\n### Host Header Forgery\n\nHawk validates the incoming request MAC against the incoming HTTP Host header. However, unless the optional `host` and `port`\noptions are used with `server.authenticate()`, a malicous client can mint new host names pointing to the server's IP address and\nuse that to craft an attack by sending a valid request that's meant for another hostname than the one used by the server. Server\nimplementors must manually verify that the host header received matches their expectation (or use the options mentioned above).\n\n# Frequently Asked Questions\n\n### Where is the protocol specification?\n\nIf you are looking for some prose explaining how all this works, **this is it**. **Hawk** is being developed as an open source\nproject instead of a standard. In other words, the [code](/hueniverse/hawk/tree/master/lib) is the specification. Not sure about\nsomething? Open an issue!\n\n### Is it done?\n\nAt if version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental\nand is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions\nand suggestions.\n\n### Where can I find **Hawk** implementations in other languages?\n\n**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, others are actively porting it to other\nplatforms. There is already a [PHP](https://github.com/alexbilbie/PHP-Hawk),\n[.NET](https://github.com/pcibraro/hawknet), and [JAVA](https://github.com/wealdtech/hawk) libraries available. The full list\nis maintained [here](https://github.com/hueniverse/hawk/issues?labels=port). Please add an issue if you are working on another\nport. A cross-platform test-suite is in the works.\n\n### Why isn't the algorithm part of the challenge or dynamically negotiated?\n\nThe algorithm used is closely related to the key issued as different algorithms require different key sizes (and other\nrequirements). While some keys can be used for multiple algorithm, the protocol is designed to closely bind the key and algorithm\ntogether as part of the issued credentials.\n\n### Why is Host and Content-Type the only headers covered by the request MAC?\n\nIt is really hard to include other headers. Headers can be changed by proxies and other intermediaries and there is no\nwell-established way to normalize them. Many platforms change the case of header field names and values. The only\nstraight-forward solution is to include the headers in some blob (say, base64 encoded JSON) and include that with the request,\nan approach taken by JWT and other such formats. However, that design violates the HTTP header boundaries, repeats information,\nand introduces other security issues because firewalls will not be aware of these \"hidden\" headers. In addition, any information\nrepeated must be compared to the duplicated information in the header and therefore only moves the problem elsewhere.\n\n### Why not just use HTTP Digest?\n\nDigest requires pre-negotiation to establish a nonce. This means you can't just make a request - you must first send\na protocol handshake to the server. This pattern has become unacceptable for most web services, especially mobile\nwhere extra round-trip are costly.\n\n### Why bother with all this nonce and timestamp business?\n\n**Hawk** is an attempt to find a reasonable, practical compromise between security and usability. OAuth 1.0 got timestamp\nand nonces halfway right but failed when it came to scalability and consistent developer experience. **Hawk** addresses\nit by requiring the client to sync its clock, but provides it with tools to accomplish it.\n\nIn general, replay protection is a matter of application-specific threat model. It is less of an issue on a TLS-protected\nsystem where the clients are implemented using best practices and are under the control of the server. Instead of dropping\nreplay protection, **Hawk** offers a required time window and an optional nonce verification. Together, it provides developers\nwith the ability to decide how to enforce their security policy without impacting the client's implementation.\n\n### What are `app` and `dlg` in the authorization header and normalized mac string?\n\nThe original motivation for **Hawk** was to replace the OAuth 1.0 use cases. This included both a simple client-server mode which\nthis module is specifically designed for, and a delegated access mode which is being developed separately in\n[Oz](https://github.com/hueniverse/oz). In addition to the **Hawk** use cases, Oz requires another attribute: the application id `app`.\nThis provides binding between the credentials and the application in a way that prevents an attacker from tricking an application\nto use credentials issued to someone else. It also has an optional 'delegated-by' attribute `dlg` which is the application id of the\napplication the credentials were directly issued to. The goal of these two additions is to allow Oz to utilize **Hawk** directly,\nbut with the additional security of delegated credentials.\n\n### What is the purpose of the static strings used in each normalized MAC input?\n\nWhen calculating a hash or MAC, a static prefix (tag) is added. The prefix is used to prevent MAC values from being\nused or reused for a purpose other than what they were created for (i.e. prevents switching MAC values between a request,\nresponse, and a bewit use cases). It also protects against expliots created after a potential change in how the protocol\ncreates the normalized string. For example, if a future version would switch the order of nonce and timestamp, it\ncan create an exploit opportunity for cases where the nonce is similar in format to a timestamp.\n\n### Does **Hawk** have anything to do with OAuth?\n\nShort answer: no.\n\n**Hawk** was originally proposed as the OAuth MAC Token specification. However, the OAuth working group in its consistent\nincompetence failed to produce a final, usable solution to address one of the most popular use cases of OAuth 1.0 - using it\nto authenticate simple client-server transactions (i.e. two-legged). As you can guess, the OAuth working group is still hard\nat work to produce more garbage.\n\n**Hawk** provides a simple HTTP authentication scheme for making client-server requests. It does not address the OAuth use case\nof delegating access to a third party. If you are looking for an OAuth alternative, check out [Oz](https://github.com/hueniverse/oz).\n\n\n# Acknowledgements\n\n**Hawk** is a derivative work of the [HTTP MAC Authentication Scheme](http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05) proposal\nco-authored by Ben Adida, Adam Barth, and Eran Hammer, which in turn was based on the OAuth 1.0 community specification.\n\nSpecial thanks to Ben Laurie for his always insightful feedback and advice.\n\nThe **Hawk** logo was created by [Chris Carrasco](http://chriscarrasco.com).\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/hueniverse/hawk/issues"
+  },
+  "homepage": "https://github.com/hueniverse/hawk",
+  "_id": "hawk@1.0.0",
+  "_from": "hawk@~1.0.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/browser.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/browser.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/browser.js	(revision 487)
@@ -0,0 +1,771 @@
+// Load modules
+
+var Lab = require('lab');
+var Hoek = require('hoek');
+var Hawk = require('../lib');
+var Browser = require('../lib/browser');
+var LocalStorage = require('localStorage');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Browser', function () {
+
+    var credentialsFunc = function (id, callback) {
+
+        var credentials = {
+            id: id,
+            key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+            algorithm: (id === '1' ? 'sha1' : 'sha256'),
+            user: 'steve'
+        };
+
+        return callback(null, credentials);
+    };
+
+    it('should generate a header then successfully parse it (configuration)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+            expect(req.authorization).to.exist;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (node request)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+                expect(res.headers['server-authorization']).to.exist;
+
+                expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (no server header options)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+                expect(res.headers['server-authorization']).to.exist;
+
+                expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (no server header)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header with stale ts and successfully authenticate on second call', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            Browser.utils.setNtpOffset(60 * 60 * 1000);
+            var header = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' });
+            req.authorization = header.field;
+            expect(req.authorization).to.exist;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Stale timestamp');
+
+                var res = {
+                    headers: {
+                        'www-authenticate': err.response.headers['WWW-Authenticate']
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                expect(Browser.utils.getNtpOffset()).to.equal(60 * 60 * 1000);
+                expect(Browser.client.authenticate(res, credentials, header.artifacts)).to.equal(true);
+                expect(Browser.utils.getNtpOffset()).to.equal(0);
+
+                req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+                expect(req.authorization).to.exist;
+
+                Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    expect(artifacts.ext).to.equal('some-app-data');
+                    done();
+                });
+            });
+        });
+    });
+
+    it('should generate a header with stale ts and successfully authenticate on second call (manual localStorage)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+            Browser.utils.setStorage(LocalStorage)
+
+            Browser.utils.setNtpOffset(60 * 60 * 1000);
+            var header = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' });
+            req.authorization = header.field;
+            expect(req.authorization).to.exist;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Stale timestamp');
+
+                var res = {
+                    headers: {
+                        'www-authenticate': err.response.headers['WWW-Authenticate']
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                expect(parseInt(LocalStorage.getItem('hawk_ntp_offset'))).to.equal(60 * 60 * 1000);
+                expect(Browser.utils.getNtpOffset()).to.equal(60 * 60 * 1000);
+                expect(Browser.client.authenticate(res, credentials, header.artifacts)).to.equal(true);
+                expect(Browser.utils.getNtpOffset()).to.equal(0);
+                expect(parseInt(LocalStorage.getItem('hawk_ntp_offset'))).to.equal(0);
+
+                req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+                expect(req.authorization).to.exist;
+
+                Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    expect(artifacts.ext).to.equal('some-app-data');
+                    done();
+                });
+            });
+        });
+    });
+
+    it('should generate a header then fails to parse it (missing server header hash)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+                expect(res.headers['server-authorization']).to.exist;
+
+                expect(Browser.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(false);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (with hash)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it then validate payload', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload('hola!', credentials, artifacts)).to.be.true;
+                expect(Hawk.server.authenticatePayload('hello!', credentials, artifacts)).to.be.false;
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (app)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(artifacts.app).to.equal('asd23ased');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (app, dlg)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased', dlg: '23434szr3q4d' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(artifacts.app).to.equal('asd23ased');
+                expect(artifacts.dlg).to.equal('23434szr3q4d');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then fail authentication due to bad hash', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, { payload: 'byebye!' }, function (err, credentials, artifacts) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Bad payload hash');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header for one resource then fail to authenticate another', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Browser.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+            req.url = '/something/else';
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.exist;
+                expect(credentials).to.exist;
+                done();
+            });
+        });
+    });
+
+    describe('client', function () {
+
+        describe('#header', function () {
+
+            it('should return a valid authorization header (sha1)', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'sha1'
+                };
+
+                var header = Browser.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
+                expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
+                done();
+            });
+
+            it('should return a valid authorization header (sha256)', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'sha256'
+                };
+
+                var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+                expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
+                done();
+            });
+
+            it('should return a valid authorization header (no ext)', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'sha256'
+                };
+
+                var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+                expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+                done();
+            });
+
+            it('should return an empty authorization header on missing options', function (done) {
+
+                var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST').field;
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on invalid credentials', function (done) {
+
+                var credentials = {
+                    key: '2983d45yun89q',
+                    algorithm: 'sha256'
+                };
+
+                var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 }).field;
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on invalid algorithm', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'hmac-sha-0'
+                };
+
+                var header = Browser.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 }).field;
+                expect(header).to.equal('');
+                done();
+            });
+        });
+
+        describe('#authenticate', function () {
+
+            it('should return false on invalid header', function (done) {
+
+                var res = {
+                    headers: {
+                        'server-authorization': 'Hawk mac="abc", bad="xyz"'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                expect(Browser.client.authenticate(res, {})).to.equal(false);
+                done();
+            });
+
+            it('should return false on invalid mac', function (done) {
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain',
+                        'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                var artifacts = {
+                    method: 'POST',
+                    host: 'example.com',
+                    port: '8080',
+                    resource: '/resource/4?filter=a',
+                    ts: '1362336900',
+                    nonce: 'eb5S_L',
+                    hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+                    ext: 'some-app-data',
+                    app: undefined,
+                    dlg: undefined,
+                    mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+                    id: '123456'
+                };
+
+                var credentials = {
+                    id: '123456',
+                    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                    algorithm: 'sha256',
+                    user: 'steve'
+                };
+
+                expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(false);
+                done();
+            });
+
+            it('should return true on ignoring hash', function (done) {
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain',
+                        'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                var artifacts = {
+                    method: 'POST',
+                    host: 'example.com',
+                    port: '8080',
+                    resource: '/resource/4?filter=a',
+                    ts: '1362336900',
+                    nonce: 'eb5S_L',
+                    hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+                    ext: 'some-app-data',
+                    app: undefined,
+                    dlg: undefined,
+                    mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+                    id: '123456'
+                };
+
+                var credentials = {
+                    id: '123456',
+                    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                    algorithm: 'sha256',
+                    user: 'steve'
+                };
+
+                expect(Browser.client.authenticate(res, credentials, artifacts)).to.equal(true);
+                done();
+            });
+
+            it('should fail on invalid WWW-Authenticate header format', function (done) {
+
+                var res = {
+                    headers: {
+                        'www-authenticate': 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                expect(Browser.client.authenticate(res, {})).to.equal(false);
+                done();
+            });
+
+            it('should fail on invalid WWW-Authenticate header format', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                    algorithm: 'sha256',
+                    user: 'steve'
+                };
+
+                var res = {
+                    headers: {
+                        'www-authenticate': 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"'
+                    },
+                    getResponseHeader: function (header) {
+
+                        return res.headers[header.toLowerCase()];
+                    }
+                };
+
+                expect(Browser.client.authenticate(res, credentials)).to.equal(false);
+                done();
+            });
+        });
+
+        describe('#message', function () {
+            it('should generate an authorization then successfully parse it', function (done) {
+
+                credentialsFunc('123456', function (err, credentials) {
+
+                    var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: credentials });
+                    expect(auth).to.exist;
+
+                    Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+                        expect(err).to.not.exist;
+                        expect(credentials.user).to.equal('steve');
+                        done();
+                    });
+                });
+            });
+
+            it('should fail on missing host', function (done) {
+
+                credentialsFunc('123456', function (err, credentials) {
+
+                    var auth = Browser.client.message(null, 8080, 'some message', { credentials: credentials });
+                    expect(auth).to.not.exist;
+                    done();
+                });
+            });
+
+            it('should fail on missing credentials', function (done) {
+
+                var auth = Browser.client.message('example.com', 8080, 'some message', {});
+                expect(auth).to.not.exist;
+                done();
+            });
+
+            it('should fail on invalid algorithm', function (done) {
+
+                credentialsFunc('123456', function (err, credentials) {
+
+                    var creds = Hoek.clone(credentials);
+                    creds.algorithm = 'blah';
+                    var auth = Browser.client.message('example.com', 8080, 'some message', { credentials: creds });
+                    expect(auth).to.not.exist;
+                    done();
+                });
+            });
+        });
+    });
+
+    describe('#parseAuthorizationHeader', function (done) {
+
+        it('returns null on missing header', function (done) {
+
+            expect(Browser.utils.parseAuthorizationHeader()).to.equal(null);
+            done();
+        });
+
+        it('returns null on bad header syntax (structure)', function (done) {
+
+            expect(Browser.utils.parseAuthorizationHeader('Hawk')).to.equal(null);
+            done();
+        });
+
+        it('returns null on bad header syntax (parts)', function (done) {
+
+            expect(Browser.utils.parseAuthorizationHeader(' ')).to.equal(null);
+            done();
+        });
+
+        it('returns null on bad scheme name', function (done) {
+
+            expect(Browser.utils.parseAuthorizationHeader('Basic asdasd')).to.equal(null);
+            done();
+        });
+
+        it('returns null on bad attribute value', function (done) {
+
+            expect(Browser.utils.parseAuthorizationHeader('Hawk test="\t"', ['test'])).to.equal(null);
+            done();
+        });
+
+        it('returns null on duplicated attribute', function (done) {
+
+            expect(Browser.utils.parseAuthorizationHeader('Hawk test="a", test="b"', ['test'])).to.equal(null);
+            done();
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/client.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/client.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/client.js	(revision 487)
@@ -0,0 +1,206 @@
+// Load modules
+
+var Url = require('url');
+var Lab = require('lab');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    describe('client', function () {
+
+        describe('#header', function () {
+
+            it('should return a valid authorization header (sha1)', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'sha1'
+                };
+
+                var header = Hawk.client.header('http://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about' }).field;
+                expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="bsvY3IfUllw6V5rvk4tStEvpBhE=", ext="Bazinga!", mac="qbf1ZPG/r/e06F4ht+T77LXi5vw="');
+                done();
+            });
+
+            it('should return a valid authorization header (sha256)', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'sha256'
+                };
+
+                var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+                expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", ext="Bazinga!", mac="q1CwFoSHzPZSkbIvl0oYlD+91rBUEvFk763nMjMndj8="');
+                done();
+            });
+
+            it('should return a valid authorization header (no ext)', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'sha256'
+                };
+
+                var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, timestamp: 1353809207, nonce: 'Ygvqdz', payload: 'something to write about', contentType: 'text/plain' }).field;
+                expect(header).to.equal('Hawk id="123456", ts="1353809207", nonce="Ygvqdz", hash="2QfCt3GuY9HQnHWyWD3wX68ZOKbynqlfYmuO2ZBRqtY=", mac="HTgtd0jPI6E4izx8e4OHdO36q00xFCU0FolNq3RiCYs="');
+                done();
+            });
+
+            it('should return an empty authorization header on missing options', function (done) {
+
+                var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST').field;
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on invalid credentials', function (done) {
+
+                var credentials = {
+                    key: '2983d45yun89q',
+                    algorithm: 'sha256'
+                };
+
+                var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, ext: 'Bazinga!', timestamp: 1353809207 }).field;
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on invalid algorithm', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: '2983d45yun89q',
+                    algorithm: 'hmac-sha-0'
+                };
+
+                var header = Hawk.client.header('https://example.net/somewhere/over/the/rainbow', 'POST', { credentials: credentials, payload: 'something, anything!', ext: 'Bazinga!', timestamp: 1353809207 }).field;
+                expect(header).to.equal('');
+                done();
+            });
+        });
+
+        describe('#authenticate', function () {
+
+            it('should return false on invalid header', function (done) {
+
+                var res = {
+                    headers: {
+                        'server-authorization': 'Hawk mac="abc", bad="xyz"'
+                    }
+                };
+
+                expect(Hawk.client.authenticate(res, {})).to.equal(false);
+                done();
+            });
+
+            it('should return false on invalid mac', function (done) {
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain',
+                        'server-authorization': 'Hawk mac="_IJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+                    }
+                };
+
+                var artifacts = {
+                    method: 'POST',
+                    host: 'example.com',
+                    port: '8080',
+                    resource: '/resource/4?filter=a',
+                    ts: '1362336900',
+                    nonce: 'eb5S_L',
+                    hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+                    ext: 'some-app-data',
+                    app: undefined,
+                    dlg: undefined,
+                    mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+                    id: '123456'
+                };
+
+                var credentials = {
+                    id: '123456',
+                    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                    algorithm: 'sha256',
+                    user: 'steve'
+                };
+
+                expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(false);
+                done();
+            });
+
+            it('should return true on ignoring hash', function (done) {
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain',
+                        'server-authorization': 'Hawk mac="XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=", hash="f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=", ext="response-specific"'
+                    }
+                };
+
+                var artifacts = {
+                    method: 'POST',
+                    host: 'example.com',
+                    port: '8080',
+                    resource: '/resource/4?filter=a',
+                    ts: '1362336900',
+                    nonce: 'eb5S_L',
+                    hash: 'nJjkVtBE5Y/Bk38Aiokwn0jiJxt/0S2WRSUwWLCf5xk=',
+                    ext: 'some-app-data',
+                    app: undefined,
+                    dlg: undefined,
+                    mac: 'BlmSe8K+pbKIb6YsZCnt4E1GrYvY1AaYayNR82dGpIk=',
+                    id: '123456'
+                };
+
+                var credentials = {
+                    id: '123456',
+                    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                    algorithm: 'sha256',
+                    user: 'steve'
+                };
+
+                expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
+                done();
+            });
+
+            it('should fail on invalid WWW-Authenticate header format', function (done) {
+
+                var header = 'Hawk ts="1362346425875", tsm="PhwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", x="Stale timestamp"';
+                expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, {})).to.equal(false);
+                done();
+            });
+
+            it('should fail on invalid WWW-Authenticate header format', function (done) {
+
+                var credentials = {
+                    id: '123456',
+                    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                    algorithm: 'sha256',
+                    user: 'steve'
+                };
+
+                var header = 'Hawk ts="1362346425875", tsm="hwayS28vtnn3qbv0mqRBYSXebN/zggEtucfeZ620Zo=", error="Stale timestamp"';
+                expect(Hawk.client.authenticate({ headers: { 'www-authenticate': header } }, credentials)).to.equal(false);
+                done();
+            });
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/crypto.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/crypto.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/crypto.js	(revision 487)
@@ -0,0 +1,86 @@
+// Load modules
+
+var Lab = require('lab');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    describe('Crypto', function () {
+
+        describe('#generateNormalizedString', function () {
+
+            it('should return a valid normalized string', function (done) {
+
+                expect(Hawk.crypto.generateNormalizedString('header', {
+                    credentials: {
+                        key: 'dasdfasdf',
+                        algorithm: 'sha256'
+                    },
+                    ts: 1357747017,
+                    nonce: 'k3k4j5',
+                    method: 'GET',
+                    resource: '/resource/something',
+                    host: 'example.com',
+                    port: 8080
+                })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\n\n');
+
+                done();
+            });
+
+            it('should return a valid normalized string (ext)', function (done) {
+
+                expect(Hawk.crypto.generateNormalizedString('header', {
+                    credentials: {
+                        key: 'dasdfasdf',
+                        algorithm: 'sha256'
+                    },
+                    ts: 1357747017,
+                    nonce: 'k3k4j5',
+                    method: 'GET',
+                    resource: '/resource/something',
+                    host: 'example.com',
+                    port: 8080,
+                    ext: 'this is some app data'
+                })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\n\nthis is some app data\n');
+
+                done();
+            });
+
+            it('should return a valid normalized string (payload + ext)', function (done) {
+
+                expect(Hawk.crypto.generateNormalizedString('header', {
+                    credentials: {
+                        key: 'dasdfasdf',
+                        algorithm: 'sha256'
+                    },
+                    ts: 1357747017,
+                    nonce: 'k3k4j5',
+                    method: 'GET',
+                    resource: '/resource/something',
+                    host: 'example.com',
+                    port: 8080,
+                    hash: 'U4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=',
+                    ext: 'this is some app data'
+                })).to.equal('hawk.1.header\n1357747017\nk3k4j5\nGET\n/resource/something\nexample.com\n8080\nU4MKKSmiVxk37JCCrAVIjV/OhB3y+NdwoCr6RShbVkE=\nthis is some app data\n');
+
+                done();
+            });
+        });
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/index.js	(revision 487)
@@ -0,0 +1,316 @@
+// Load modules
+
+var Url = require('url');
+var Lab = require('lab');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    var credentialsFunc = function (id, callback) {
+
+        var credentials = {
+            id: id,
+            key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+            algorithm: (id === '1' ? 'sha1' : 'sha256'),
+            user: 'steve'
+        };
+
+        return callback(null, credentials);
+    };
+
+    it('should generate a header then successfully parse it (configuration)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header(Url.parse('http://example.com:8080/resource/4?filter=a'), req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+            expect(req.authorization).to.exist;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (node request)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    }
+                };
+
+                res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts, { payload: 'some reply', contentType: 'text/plain', ext: 'response-specific' });
+                expect(res.headers['server-authorization']).to.exist;
+
+                expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(true);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (no server header options)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    }
+                };
+
+                res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+                expect(res.headers['server-authorization']).to.exist;
+
+                expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then fails to parse it (missing server header hash)', function (done) {
+
+        var req = {
+            method: 'POST',
+            url: '/resource/4?filter=a',
+            headers: {
+                host: 'example.com:8080',
+                'content-type': 'text/plain;x=y'
+            }
+        };
+
+        var payload = 'some not so random text';
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var reqHeader = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', payload: payload, contentType: req.headers['content-type'] });
+            req.headers.authorization = reqHeader.field;
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload(payload, credentials, artifacts, req.headers['content-type'])).to.equal(true);
+
+                var res = {
+                    headers: {
+                        'content-type': 'text/plain'
+                    }
+                };
+
+                res.headers['server-authorization'] = Hawk.server.header(credentials, artifacts);
+                expect(res.headers['server-authorization']).to.exist;
+
+                expect(Hawk.client.authenticate(res, credentials, artifacts, { payload: 'some reply' })).to.equal(false);
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (with hash)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it then validate payload', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(Hawk.server.authenticatePayload('hola!', credentials, artifacts)).to.be.true;
+                expect(Hawk.server.authenticatePayload('hello!', credentials, artifacts)).to.be.false;
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (app)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(artifacts.app).to.equal('asd23ased');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then successfully parse it (app, dlg)', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data', app: 'asd23ased', dlg: '23434szr3q4d' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(artifacts.ext).to.equal('some-app-data');
+                expect(artifacts.app).to.equal('asd23ased');
+                expect(artifacts.dlg).to.equal('23434szr3q4d');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header then fail authentication due to bad hash', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, payload: 'hola!', ext: 'some-app-data' }).field;
+            Hawk.server.authenticate(req, credentialsFunc, { payload: 'byebye!' }, function (err, credentials, artifacts) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Bad payload hash');
+                done();
+            });
+        });
+    });
+
+    it('should generate a header for one resource then fail to authenticate another', function (done) {
+
+        var req = {
+            method: 'GET',
+            url: '/resource/4?filter=a',
+            host: 'example.com',
+            port: 8080
+        };
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            req.authorization = Hawk.client.header('http://example.com:8080/resource/4?filter=a', req.method, { credentials: credentials, ext: 'some-app-data' }).field;
+            req.url = '/something/else';
+
+            Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                expect(err).to.exist;
+                expect(credentials).to.exist;
+                done();
+            });
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/message.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/message.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/message.js	(revision 487)
@@ -0,0 +1,246 @@
+// Load modules
+
+var Url = require('url');
+var Lab = require('lab');
+var Hoek = require('hoek');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    var credentialsFunc = function (id, callback) {
+
+        var credentials = {
+            id: id,
+            key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+            algorithm: (id === '1' ? 'sha1' : 'sha256'),
+            user: 'steve'
+        };
+
+        return callback(null, credentials);
+    };
+
+    it('should generate an authorization then successfully parse it', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on mismatching host', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            Hawk.server.authenticateMessage('example1.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Bad mac');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on stale timestamp', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { localtimeOffsetMsec: 100000 }, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Stale timestamp');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on invalid authorization', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+            delete auth.id;
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Invalid authorization');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on bad hash', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message1', auth, credentialsFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Bad message hash');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on nonce error', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, credentialsFunc, { nonceFunc: function (nonce, ts, callback) { callback (new Error('kaboom')); } }, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Invalid nonce');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on credentials error', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            var errFunc = function (id, callback) {
+
+                callback(new Error('kablooey'));
+            };
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('kablooey');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on missing credentials', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            var errFunc = function (id, callback) {
+
+                callback();
+            };
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Unknown credentials');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on invalid credentials', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            var errFunc = function (id, callback) {
+
+                callback(null, {});
+            };
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Invalid credentials');
+                done();
+            });
+        });
+    });
+
+    it('should fail authorization on invalid credentials algorithm', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: credentials });
+            expect(auth).to.exist;
+
+            var errFunc = function (id, callback) {
+
+                callback(null, { key: '123', algorithm: '456' });
+            };
+
+            Hawk.server.authenticateMessage('example.com', 8080, 'some message', auth, errFunc, {}, function (err, credentials) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Unknown algorithm');
+                done();
+            });
+        });
+    });
+
+    it('should fail on missing host', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var auth = Hawk.client.message(null, 8080, 'some message', { credentials: credentials });
+            expect(auth).to.not.exist;
+            done();
+        });
+    });
+
+    it('should fail on missing credentials', function (done) {
+
+        var auth = Hawk.client.message('example.com', 8080, 'some message', {});
+        expect(auth).to.not.exist;
+        done();
+    });
+
+    it('should fail on invalid algorithm', function (done) {
+
+        credentialsFunc('123456', function (err, credentials) {
+
+            var creds = Hoek.clone(credentials);
+            creds.algorithm = 'blah';
+            var auth = Hawk.client.message('example.com', 8080, 'some message', { credentials: creds });
+            expect(auth).to.not.exist;
+            done();
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/readme.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/readme.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/readme.js	(revision 487)
@@ -0,0 +1,98 @@
+// Load modules
+
+var Lab = require('lab');
+var Hoek = require('hoek');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    describe('README', function () {
+
+        describe('core', function () {
+
+            var credentials = {
+                id: 'dh37fgj492je',
+                key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                algorithm: 'sha256'
+            };
+
+            var options = {
+                credentials: credentials,
+                timestamp: 1353832234,
+                nonce: 'j4h3g2',
+                ext: 'some-app-ext-data'
+            };
+
+            it('should generate a header protocol example', function (done) {
+
+                var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', options).field;
+
+                expect(header).to.equal('Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", ext="some-app-ext-data", mac="6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE="');
+                done();
+            });
+
+            it('should generate a normalized string protocol example', function (done) {
+
+                var normalized = Hawk.crypto.generateNormalizedString('header', {
+                    credentials: credentials,
+                    ts: options.timestamp,
+                    nonce: options.nonce,
+                    method: 'GET',
+                    resource: '/resource?a=1&b=2',
+                    host: 'example.com',
+                    port: 8000,
+                    ext: options.ext
+                });
+
+                expect(normalized).to.equal('hawk.1.header\n1353832234\nj4h3g2\nGET\n/resource?a=1&b=2\nexample.com\n8000\n\nsome-app-ext-data\n');
+                done();
+            });
+
+            var payloadOptions = Hoek.clone(options);
+            payloadOptions.payload = 'Thank you for flying Hawk';
+            payloadOptions.contentType = 'text/plain';
+
+            it('should generate a header protocol example (with payload)', function (done) {
+
+                var header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'POST', payloadOptions).field;
+
+                expect(header).to.equal('Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", hash="Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=", ext="some-app-ext-data", mac="aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw="');
+                done();
+            });
+
+            it('should generate a normalized string protocol example (with payload)', function (done) {
+
+                var normalized = Hawk.crypto.generateNormalizedString('header', {
+                    credentials: credentials,
+                    ts: options.timestamp,
+                    nonce: options.nonce,
+                    method: 'POST',
+                    resource: '/resource?a=1&b=2',
+                    host: 'example.com',
+                    port: 8000,
+                    hash: Hawk.crypto.calculatePayloadHash(payloadOptions.payload, credentials.algorithm, payloadOptions.contentType),
+                    ext: options.ext
+                });
+
+                expect(normalized).to.equal('hawk.1.header\n1353832234\nj4h3g2\nPOST\n/resource?a=1&b=2\nexample.com\n8000\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\nsome-app-ext-data\n');
+                done();
+            });
+        });
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/server.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/server.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/server.js	(revision 487)
@@ -0,0 +1,686 @@
+// Load modules
+
+var Url = require('url');
+var Lab = require('lab');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    describe('server', function () {
+
+        var credentialsFunc = function (id, callback) {
+
+            var credentials = {
+                id: id,
+                key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                algorithm: (id === '1' ? 'sha1' : 'sha256'),
+                user: 'steve'
+            };
+
+            return callback(null, credentials);
+        };
+
+        describe('#authenticate', function () {
+
+            it('should parse a valid authentication header (sha1)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    done();
+                });
+            });
+
+            it('should parse a valid authentication header (sha256)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/1?b=1&a=2',
+                    host: 'example.com',
+                    port: 8000,
+                    authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", mac="m8r1rHbXN6NgO+KIIhjO7sFRyd78RNGVUwehe8Cp2dU=", ext="some-app-data"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353832234000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    done();
+                });
+            });
+
+            it('should parse a valid authentication header (host override)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: 'example1.com:8080',
+                        authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+                    }
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { host: 'example.com', localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    done();
+                });
+            });
+
+            it('should parse a valid authentication header (host port override)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: 'example1.com:80',
+                        authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+                    }
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { host: 'example.com', port: 8080, localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    done();
+                });
+            });
+
+            it('should parse a valid authentication header (POST with payload)', function (done) {
+
+                var req = {
+                    method: 'POST',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123456", ts="1357926341", nonce="1AwuJD", hash="qAiXIVv+yjDATneWxZP2YCTa9aHRgQdnH9b3Wc+o3dg=", ext="some-app-data", mac="UeYcj5UoTVaAWXNvJfLVia7kU3VabxCqrccXP8sUGC4="'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1357926341000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    done();
+                });
+            });
+
+            it('should fail on missing hash', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/1?b=1&a=2',
+                    host: 'example.com',
+                    port: 8000,
+                    authorization: 'Hawk id="dh37fgj492je", ts="1353832234", nonce="j4h3g2", mac="m8r1rHbXN6NgO+KIIhjO7sFRyd78RNGVUwehe8Cp2dU=", ext="some-app-data"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { payload: 'body', localtimeOffsetMsec: 1353832234000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Missing required payload hash');
+                    done();
+                });
+            });
+
+            it('should fail on a stale timestamp', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123456", ts="1362337299", nonce="UzmxSs", ext="some-app-data", mac="wnNUxchvvryMH2RxckTdZ/gY3ijzvccx4keVvELC61w="'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Stale timestamp');
+                    var header = err.response.headers['WWW-Authenticate'];
+                    var ts = header.match(/^Hawk ts\=\"(\d+)\"\, tsm\=\"([^\"]+)\"\, error=\"Stale timestamp\"$/);
+                    var now = Hawk.utils.now();
+                    expect(parseInt(ts[1], 10) * 1000).to.be.within(now - 1000, now + 1000);
+
+                    var res = {
+                        headers: {
+                            'www-authenticate': header
+                        }
+                    };
+
+                    expect(Hawk.client.authenticate(res, credentials, artifacts)).to.equal(true);
+                    done();
+                });
+            });
+
+            it('should fail on a replay', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="bXx7a7p1h9QYQNZ8x7QhvDQym8ACgab4m3lVSFn4DBw=", ext="hello"'
+                };
+
+                var memoryCache = {};
+                var options = {
+                    localtimeOffsetMsec: 1353788437000 - Hawk.utils.now(),
+                    nonceFunc: function (nonce, ts, callback) {
+
+                        if (memoryCache[nonce]) {
+                            return callback(new Error());
+                        }
+
+                        memoryCache[nonce] = true;
+                        return callback();
+                    }
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, options, function (err, credentials, artifacts) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+
+                    Hawk.server.authenticate(req, credentialsFunc, options, function (err, credentials, artifacts) {
+
+                        expect(err).to.exist;
+                        expect(err.response.payload.message).to.equal('Invalid nonce');
+                        done();
+                    });
+                });
+            });
+
+            it('should fail on an invalid authentication header: wrong scheme', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Basic asdasdasdasd'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.not.exist;
+                    done();
+                });
+            });
+
+            it('should fail on an invalid authentication header: no scheme', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: '!@#'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Invalid header syntax');
+                    done();
+                });
+            });
+
+            it('should fail on an missing authorization header', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.isMissing).to.equal(true);
+                    done();
+                });
+            });
+
+            it('should fail on an missing host header', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                    }
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Invalid Host header');
+                    done();
+                });
+            });
+
+            it('should fail on an missing authorization attribute (id)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Missing attributes');
+                    done();
+                });
+            });
+
+            it('should fail on an missing authorization attribute (ts)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Missing attributes');
+                    done();
+                });
+            });
+
+            it('should fail on an missing authorization attribute (nonce)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Missing attributes');
+                    done();
+                });
+            });
+
+            it('should fail on an missing authorization attribute (mac)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Missing attributes');
+                    done();
+                });
+            });
+
+            it('should fail on an unknown authorization attribute', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", x="3", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Unknown attribute: x');
+                    done();
+                });
+            });
+
+            it('should fail on an bad authorization header format', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123\\", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Bad header format');
+                    done();
+                });
+            });
+
+            it('should fail on an bad authorization attribute value', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="\t", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Bad attribute value: id');
+                    done();
+                });
+            });
+
+            it('should fail on an empty authorization attribute value', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Bad attribute value: id');
+                    done();
+                });
+            });
+
+            it('should fail on duplicated authorization attribute key', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", id="456", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Duplicate attribute: id');
+                    done();
+                });
+            });
+
+            it('should fail on an invalid authorization header format', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk'
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Invalid header syntax');
+                    done();
+                });
+            });
+
+            it('should fail on an bad host header (missing host)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: ':8080',
+                        authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                    }
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Invalid Host header');
+                    done();
+                });
+            });
+
+            it('should fail on an bad host header (pad port)', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: 'example.com:something',
+                        authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                    }
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Invalid Host header');
+                    done();
+                });
+            });
+
+            it('should fail on credentialsFunc error', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                var credentialsFunc = function (id, callback) {
+
+                    return callback(new Error('Unknown user'));
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.message).to.equal('Unknown user');
+                    done();
+                });
+            });
+
+            it('should fail on missing credentials', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                var credentialsFunc = function (id, callback) {
+
+                    return callback(null, null);
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Unknown credentials');
+                    done();
+                });
+            });
+
+            it('should fail on invalid credentials', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                var credentialsFunc = function (id, callback) {
+
+                    var credentials = {
+                        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                        user: 'steve'
+                    };
+
+                    return callback(null, credentials);
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.message).to.equal('Invalid credentials');
+                    expect(err.response.payload.message).to.equal('An internal server error occurred');
+                    done();
+                });
+            });
+
+            it('should fail on unknown credentials algorithm', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcUyW6EEgUH4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                var credentialsFunc = function (id, callback) {
+
+                    var credentials = {
+                        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                        algorithm: 'hmac-sha-0',
+                        user: 'steve'
+                    };
+
+                    return callback(null, credentials);
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.message).to.equal('Unknown algorithm');
+                    expect(err.response.payload.message).to.equal('An internal server error occurred');
+                    done();
+                });
+            });
+
+            it('should fail on unknown bad mac', function (done) {
+
+                var req = {
+                    method: 'GET',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080,
+                    authorization: 'Hawk id="123", ts="1353788437", nonce="k3j4h2", mac="/qwS4UjfVWMcU4jlr7T/wuKe3dKijvTvSos=", ext="hello"'
+                };
+
+                var credentialsFunc = function (id, callback) {
+
+                    var credentials = {
+                        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                        algorithm: 'sha256',
+                        user: 'steve'
+                    };
+
+                    return callback(null, credentials);
+                };
+
+                Hawk.server.authenticate(req, credentialsFunc, { localtimeOffsetMsec: 1353788437000 - Hawk.utils.now() }, function (err, credentials, artifacts) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Bad mac');
+                    done();
+                });
+            });
+        });
+
+        describe('#header', function () {
+
+            it('should return an empty authorization header on missing options', function (done) {
+
+                var header = Hawk.server.header();
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on missing credentials', function (done) {
+
+                var header = Hawk.server.header(null, {});
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on invalid credentials', function (done) {
+
+                var credentials = {
+                    key: '2983d45yun89q'
+                };
+
+                var header = Hawk.server.header(credentials);
+                expect(header).to.equal('');
+                done();
+            });
+
+            it('should return an empty authorization header on invalid algorithm', function (done) {
+
+                var artifacts = {
+                    id: '123456'
+                };
+
+                var credentials = {
+                    key: '2983d45yun89q',
+                    algorithm: 'hmac-sha-0'
+                };
+
+                var header = Hawk.server.header(credentials, artifacts);
+                expect(header).to.equal('');
+                done();
+            });
+        });
+    });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/uri.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/uri.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/uri.js	(revision 487)
@@ -0,0 +1,456 @@
+// Load modules
+
+var Http = require('http');
+var Lab = require('lab');
+var Hawk = require('../lib');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    describe('Uri', function () {
+
+        var credentialsFunc = function (id, callback) {
+
+            var credentials = {
+                id: id,
+                key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',
+                algorithm: 'sha256',
+                user: 'steve'
+            };
+
+            return callback(null, credentials);
+        };
+
+        it('should generate a bewit then successfully authenticate it', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?a=1&b=2',
+                host: 'example.com',
+                port: 80
+            };
+
+            credentialsFunc('123456', function (err, credentials) {
+
+                var bewit = Hawk.uri.getBewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100, ext: 'some-app-data' });
+                req.url += '&bewit=' + bewit;
+
+                Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    expect(attributes.ext).to.equal('some-app-data');
+                    done();
+                });
+            });
+        });
+
+        it('should generate a bewit then successfully authenticate it (no ext)', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?a=1&b=2',
+                host: 'example.com',
+                port: 80
+            };
+
+            credentialsFunc('123456', function (err, credentials) {
+
+                var bewit = Hawk.uri.getBewit('http://example.com/resource/4?a=1&b=2', { credentials: credentials, ttlSec: 60 * 60 * 24 * 365 * 100 });
+                req.url += '&bewit=' + bewit;
+
+                Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                    expect(err).to.not.exist;
+                    expect(credentials.user).to.equal('steve');
+                    done();
+                });
+            });
+        });
+
+        it('should successfully authenticate a request (last param)', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?a=1&b=2&bewit=MTIzNDU2XDQ1MTE0ODQ2MjFcMzFjMmNkbUJFd1NJRVZDOVkva1NFb2c3d3YrdEVNWjZ3RXNmOGNHU2FXQT1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(attributes.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+
+        it('should successfully authenticate a request (first param)', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2MjFcMzFjMmNkbUJFd1NJRVZDOVkva1NFb2c3d3YrdEVNWjZ3RXNmOGNHU2FXQT1cc29tZS1hcHAtZGF0YQ&a=1&b=2',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(attributes.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+
+        it('should successfully authenticate a request (only param)', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2NDFcZm1CdkNWT3MvcElOTUUxSTIwbWhrejQ3UnBwTmo4Y1VrSHpQd3Q5OXJ1cz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.not.exist;
+                expect(credentials.user).to.equal('steve');
+                expect(attributes.ext).to.equal('some-app-data');
+                done();
+            });
+        });
+
+        it('should fail on multiple authentication', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MTE0ODQ2NDFcZm1CdkNWT3MvcElOTUUxSTIwbWhrejQ3UnBwTmo4Y1VrSHpQd3Q5OXJ1cz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080,
+                authorization: 'Basic asdasdasdasd'
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Multiple authentications');
+                done();
+            });
+        });
+
+        it('should fail on method other than GET', function (done) {
+
+            credentialsFunc('123456', function (err, credentials) {
+
+                var req = {
+                    method: 'POST',
+                    url: '/resource/4?filter=a',
+                    host: 'example.com',
+                    port: 8080
+                };
+
+                var exp = Math.floor(Hawk.utils.now() / 1000) + 60;
+                var ext = 'some-app-data';
+                var mac = Hawk.crypto.calculateMac('bewit', credentials, {
+                    timestamp: exp,
+                    nonce: '',
+                    method: req.method,
+                    resource: req.url,
+                    host: req.host,
+                    port: req.port,
+                    ext: ext
+                });
+
+                var bewit = credentials.id + '\\' + exp + '\\' + mac + '\\' + ext;
+
+                req.url += '&bewit=' + Hawk.utils.base64urlEncode(bewit);
+
+                Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                    expect(err).to.exist;
+                    expect(err.response.payload.message).to.equal('Invalid method');
+                    done();
+                });
+            });
+        });
+
+        it('should fail on invalid host header', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+                headers: {
+                    host: 'example.com:something'
+                }
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Invalid Host header');
+                done();
+            });
+        });
+
+        it('should fail on empty bewit', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Empty bewit');
+                expect(err.isMissing).to.not.exist;
+                done();
+            });
+        });
+
+        it('should fail on invalid bewit', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=*',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Invalid bewit encoding');
+                expect(err.isMissing).to.not.exist;
+                done();
+            });
+        });
+
+        it('should fail on missing bewit', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.not.exist;
+                expect(err.isMissing).to.equal(true);
+                done();
+            });
+        });
+
+        it('should fail on invalid bewit structure', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=abc',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Invalid bewit structure');
+                done();
+            });
+        });
+
+        it('should fail on empty bewit attribute', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=YVxcY1xk',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Missing bewit attributes');
+                done();
+            });
+        });
+
+        it('should fail on expired access', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?a=1&b=2&bewit=MTIzNDU2XDEzNTY0MTg1ODNcWk1wZlMwWU5KNHV0WHpOMmRucTRydEk3NXNXTjFjeWVITTcrL0tNZFdVQT1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Access expired');
+                done();
+            });
+        });
+
+        it('should fail on credentials function error', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, function (id, callback) { callback(Hawk.error.badRequest('Boom')); }, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Boom');
+                done();
+            });
+        });
+
+        it('should fail on null credentials function response', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, function (id, callback) { callback(null, null); }, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Unknown credentials');
+                done();
+            });
+        });
+
+        it('should fail on invalid credentials function response', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, function (id, callback) { callback(null, {}); }, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Invalid credentials');
+                done();
+            });
+        });
+
+        it('should fail on invalid credentials function response (unknown algorithm)', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, function (id, callback) { callback(null, { key: 'xxx', algorithm: 'xxx' }); }, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.message).to.equal('Unknown algorithm');
+                done();
+            });
+        });
+
+        it('should fail on expired access', function (done) {
+
+            var req = {
+                method: 'GET',
+                url: '/resource/4?bewit=MTIzNDU2XDQ1MDk5OTE3MTlcTUE2eWkwRWRwR0pEcWRwb0JkYVdvVDJrL0hDSzA1T0Y3MkhuZlVmVy96Zz1cc29tZS1hcHAtZGF0YQ',
+                host: 'example.com',
+                port: 8080
+            };
+
+            Hawk.uri.authenticate(req, function (id, callback) { callback(null, { key: 'xxx', algorithm: 'sha256' }); }, {}, function (err, credentials, attributes) {
+
+                expect(err).to.exist;
+                expect(err.response.payload.message).to.equal('Bad mac');
+                done();
+            });
+        });
+    });
+
+    describe('#getBewit', function () {
+
+        it('should return a valid bewit value', function (done) {
+
+            var credentials = {
+                id: '123456',
+                key: '2983d45yun89q',
+                algorithm: 'sha256'
+            };
+
+            var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, localtimeOffsetMsec: 1356420407232 - Hawk.utils.now(), ext: 'xandyandz' });
+            expect(bewit).to.equal('MTIzNDU2XDEzNTY0MjA3MDdca3NjeHdOUjJ0SnBQMVQxekRMTlBiQjVVaUtJVTl0T1NKWFRVZEc3WDloOD1ceGFuZHlhbmR6');
+            done();
+        });
+
+        it('should return an empty bewit on invalid credentials', function (done) {
+
+            var credentials = {
+                key: '2983d45yun89q',
+                algorithm: 'sha256'
+            };
+
+            var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 3000, ext: 'xandyandz' });
+            expect(bewit).to.equal('');
+            done();
+        });
+
+        it('should return an empty bewit on invalid algorithm', function (done) {
+
+            var credentials = {
+                id: '123456',
+                key: '2983d45yun89q',
+                algorithm: 'hmac-sha-0'
+            };
+
+            var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow', { credentials: credentials, ttlSec: 300, ext: 'xandyandz' });
+            expect(bewit).to.equal('');
+            done();
+        });
+
+        it('should return an empty bewit on missing options', function (done) {
+
+            var credentials = {
+                id: '123456',
+                key: '2983d45yun89q',
+                algorithm: 'hmac-sha-0'
+            };
+
+            var bewit = Hawk.uri.getBewit('https://example.com/somewhere/over/the/rainbow');
+            expect(bewit).to.equal('');
+            done();
+        });
+    });
+});
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/utils.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/utils.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/hawk/test/utils.js	(revision 487)
@@ -0,0 +1,120 @@
+// Load modules
+
+var Lab = require('lab');
+var Hawk = require('../lib');
+var Package = require('../package.json');
+
+
+// Declare internals
+
+var internals = {};
+
+
+// Test shortcuts
+
+var expect = Lab.expect;
+var before = Lab.before;
+var after = Lab.after;
+var describe = Lab.experiment;
+var it = Lab.test;
+
+
+describe('Hawk', function () {
+
+    describe('Utils', function () {
+
+        describe('#parseHost', function () {
+
+            it('returns port 80 for non tls node request', function (done) {
+
+                var req = {
+                    method: 'POST',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: 'example.com',
+                        'content-type': 'text/plain;x=y'
+                    }
+                };
+
+                expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(80);
+                done();
+            });
+
+            it('returns port 443 for non tls node request', function (done) {
+
+                var req = {
+                    method: 'POST',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: 'example.com',
+                        'content-type': 'text/plain;x=y'
+                    },
+                    connection: {
+                        encrypted: true
+                    }
+                };
+
+                expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(443);
+                done();
+            });
+
+            it('returns port 443 for non tls node request (IPv6)', function (done) {
+
+                var req = {
+                    method: 'POST',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: '[123:123:123]',
+                        'content-type': 'text/plain;x=y'
+                    },
+                    connection: {
+                        encrypted: true
+                    }
+                };
+
+                expect(Hawk.utils.parseHost(req, 'Host').port).to.equal(443);
+                done();
+            });
+
+            it('parses IPv6 headers', function (done) {
+
+                var req = {
+                    method: 'POST',
+                    url: '/resource/4?filter=a',
+                    headers: {
+                        host: '[123:123:123]:8000',
+                        'content-type': 'text/plain;x=y'
+                    },
+                    connection: {
+                        encrypted: true
+                    }
+                };
+
+                var host = Hawk.utils.parseHost(req, 'Host');
+                expect(host.port).to.equal('8000');
+                expect(host.name).to.equal('[123:123:123]');
+                done();
+            });
+        });
+
+        describe('#version', function () {
+
+            it('returns the correct package version number', function (done) {
+
+                expect(Hawk.utils.version()).to.equal(Package.version);
+                done();
+            });
+        });
+
+        describe('#unauthorized', function () {
+
+            it('returns a hawk 401', function (done) {
+
+                expect(Hawk.utils.unauthorized('kaboom').response.headers['WWW-Authenticate']).to.equal('Hawk error="kaboom"');
+                done();
+            });
+        });
+    });
+});
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/.dir-locals.el
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/.dir-locals.el	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/.dir-locals.el	(revision 487)
@@ -0,0 +1,6 @@
+((nil . ((indent-tabs-mode . nil)
+         (tab-width . 8)
+         (fill-column . 80)))
+ (js-mode . ((js-indent-level . 2)
+             (indent-tabs-mode . nil)
+             )))
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/.npmignore	(revision 487)
@@ -0,0 +1,7 @@
+.gitmodules
+deps
+docs
+Makefile
+node_modules
+test
+tools
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/LICENSE	(revision 487)
@@ -0,0 +1,18 @@
+Copyright Joyent, Inc. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/README.md	(revision 487)
@@ -0,0 +1,75 @@
+# node-http-signature
+
+node-http-signature is a node.js library that has client and server components
+for Joyent's [HTTP Signature Scheme](http_signing.md).
+
+## Usage
+
+Note the example below signs a request with the same key/cert used to start an
+HTTP server. This is almost certainly not what you actaully want, but is just
+used to illustrate the API calls; you will need to provide your own key
+management in addition to this library.
+
+### Client
+
+    var fs = require('fs');
+    var https = require('https');
+    var httpSignature = require('http-signature');
+
+    var key = fs.readFileSync('./key.pem', 'ascii');
+
+    var options = {
+      host: 'localhost',
+      port: 8443,
+      path: '/',
+      method: 'GET',
+      headers: {}
+    };
+
+    // Adds a 'Date' header in, signs it, and adds the
+    // 'Authorization' header in.
+    var req = https.request(options, function(res) {
+      console.log(res.statusCode);
+    });
+
+
+    httpSignature.sign(req, {
+      key: key,
+      keyId: './cert.pem'
+    });
+
+    req.end();
+
+### Server
+
+    var fs = require('fs');
+    var https = require('https');
+    var httpSignature = require('http-signature');
+
+    var options = {
+      key: fs.readFileSync('./key.pem'),
+      cert: fs.readFileSync('./cert.pem')
+    };
+
+    https.createServer(options, function (req, res) {
+      var rc = 200;
+      var parsed = httpSignature.parseRequest(req);
+      var pub = fs.readFileSync(parsed.keyId, 'ascii');
+      if (!httpSignature.verifySignature(parsed, pub))
+        rc = 401;
+
+      res.writeHead(rc);
+      res.end();
+    }).listen(8443);
+
+## Installation
+
+    npm install http-signature
+
+## License
+
+MIT.
+
+## Bugs
+
+See <https://github.com/joyent/node-http-signature/issues>.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/http_signing.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/http_signing.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/http_signing.md	(revision 487)
@@ -0,0 +1,296 @@
+# Abstract
+
+This document describes a way to add origin authentication, message integrity,
+and replay resistance to HTTP REST requests.  It is intended to be used over
+the HTTPS protocol.
+
+# Copyright Notice
+
+Copyright (c) 2011 Joyent, Inc. and the persons identified as document authors.
+All rights reserved.
+
+Code Components extracted from this document must include MIT License text.
+
+# Introduction
+
+This protocol is intended to provide a standard way for clients to sign HTTP
+requests.  RFC2617 (HTTP Authentication) defines Basic and Digest authentication
+mechanisms, and RFC5246 (TLS 1.2) defines client-auth, both of which are widely
+employed on the Internet today.  However, it is common place that the burdens of
+PKI prevent web service operators from deploying that methodoloy, and so many
+fall back to Basic authentication, which has poor security characteristics.
+
+Additionally, OAuth provides a fully-specified alternative for authorization
+of web service requests, but is not (always) ideal for machine to machine
+communication, as the key acquisition steps (generally) imply a fixed
+infrastructure that may not make sense to a service provider (e.g., symmetric
+keys).
+
+Several web service providers have invented their own schemes for signing
+HTTP requests, but to date, none have been placed in the public domain as a
+standard.  This document serves that purpose.  There are no techniques in this
+proposal that are novel beyond previous art, however, this aims to be a simple
+mechanism for signing these requests.
+
+# Signature Authentication Scheme
+
+The "signature" authentication scheme is based on the model that the client must
+authenticate itself with a digital signature produced by either a private
+asymmetric key (e.g., RSA) or a shared symmetric key (e.g., HMAC).  The scheme
+is parameterized enough such that it is not bound to any particular key type or
+signing algorithm.  However, it does explicitly assume that clients can send an
+HTTP `Date` header.
+
+## Authorization Header
+
+The client is expected to send an Authorization header (as defined in RFC 2617)
+with the following parameterization:
+
+    credentials := "Signature" params
+    params := 1#(keyId | algorithm | [headers] | [ext] | signature)
+    digitalSignature := plain-string
+
+    keyId := "keyId" "=" <"> plain-string <">
+    algorithm := "algorithm" "=" <"> plain-string <">
+    headers := "headers" "=" <"> 1#headers-value <">
+    ext := "ext" "=" <"> plain-string <">
+    signature := "signature" "=" <"> plain-string <">
+
+    headers-value := plain-string
+    plain-string   = 1*( %x20-21 / %x23-5B / %x5D-7E )
+
+### Signature Parameters
+
+#### keyId
+
+REQUIRED.  The `keyId` field is an opaque string that the server can use to look
+up the component they need to validate the signature.  It could be an SSH key
+fingerprint, an LDAP DN, etc.  Management of keys and assignment of `keyId` is
+out of scope for this document.
+
+#### algorithm
+
+REQUIRED. The `algorithm` parameter is used if the client and server agree on a
+non-standard digital signature algorithm.  The full list of supported signature
+mechanisms is listed below.
+
+#### headers
+
+OPTIONAL.  The `headers` parameter is used to specify the list of HTTP headers
+used to sign the request.  If specified, it should be a quoted list of HTTP
+header names, separated by a single space character.  By default, only one
+HTTP header is signed, which is the `Date` header.  Note that the list MUST be
+specified in the order the values are concatenated together during signing. To
+include the HTTP request line in the signature calculation, use the special
+`request-line` value.  While this is overloading the definition of `headers` in
+HTTP linguism, the request-line is defined in RFC 2616, and as the outlier from
+headers in useful signature calculation, it is deemed simpler to simply use
+`request-line` than to add a separate parameter for it.
+
+#### extensions
+
+OPTIONAL.  The `extensions` parameter is used to include additional information
+which is covered by the request.  The content and format of the string is out of
+scope for this document, and expected to be specified by implementors.
+
+#### signature
+
+REQUIRED.  The `signature` parameter is a `Base64` encoded digital signature
+generated by the client. The client uses the `algorithm` and `headers` request
+parameters to form a canonicalized `signing string`.  This `signing string` is
+then signed with the key associated with `keyId` and the algorithm
+corresponding to `algorithm`.  The `signature` parameter is then set to the
+`Base64` encoding of the signature.
+
+### Signing String Composition
+
+In order to generate the string that is signed with a key, the client MUST take
+the values of each HTTP header specified by `headers` in the order they appear.
+
+1. If the header name is not `request-line` then append the lowercased header
+   name followed with an ASCII colon `:` and an ASCII space ` `.
+2. If the header name is `request-line` then appened the HTTP request line,
+   otherwise append the header value.
+3. If value is not the last value then append an ASCII newline `\n`. The string
+   MUST NOT include a trailing ASCII newline.
+
+# Example Requests
+
+All requests refer to the following request (body ommitted):
+
+    POST /foo HTTP/1.1
+    Host: example.org
+    Date: Tue, 07 Jun 2011 20:51:35 GMT
+    Content-Type: application/json
+    Content-MD5: h0auK8hnYJKmHTLhKtMTkQ==
+    Content-Length: 123
+
+The "rsa-key-1" keyId refers to a private key known to the client and a public
+key known to the server. The "hmac-key-1" keyId refers to key known to the
+client and server.
+
+## Default parameterization
+
+The authorization header and signature would be generated as:
+
+    Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",signature="Base64(RSA-SHA256(signing string))"
+
+The client would compose the signing string as:
+
+    date: Tue, 07 Jun 2011 20:51:35 GMT
+
+## Header List
+
+The authorization header and signature would be generated as:
+
+    Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",headers="request-line date content-type content-md5",signature="Base64(RSA-SHA256(signing string))"
+
+The client would compose the signing string as (`+ "\n"` inserted for
+readability):
+
+    POST /foo HTTP/1.1 + "\n"
+    date: Tue, 07 Jun 2011 20:51:35 GMT + "\n"
+    content-type: application/json + "\n"
+    content-md5: h0auK8hnYJKmHTLhKtMTkQ==
+
+## Algorithm
+
+The authorization header and signature would be generated as:
+
+    Authorization: Signature keyId="hmac-key-1",algorithm="hmac-sha1",signature="Base64(HMAC-SHA1(signing string))"
+
+The client would compose the signing string as:
+
+    date: Tue, 07 Jun 2011 20:51:35 GMT
+
+# Signing Algorithms
+
+Currently supported algorithm names are:
+
+* rsa-sha1
+* rsa-sha256
+* rsa-sha512
+* dsa-sha1
+* hmac-sha1
+* hmac-sha256
+* hmac-sha512
+
+# Security Considerations
+
+## Default Parameters
+
+Note the default parameterization of the `Signature` scheme is only safe if all
+requests are carried over a secure transport (i.e., TLS).  Sending the default
+scheme over a non-secure transport will leave the request vulnerable to
+spoofing, tampering, replay/repudiaton, and integrity violations (if using the
+STRIDE threat-modeling methodology).
+
+## Insecure Transports
+
+If sending the request over plain HTTP, service providers SHOULD require clients
+to sign ALL HTTP headers, and the `request-line`.  Additionally, service
+providers SHOULD require `Content-MD5` calculations to be performed to ensure
+against any tampering from clients.
+
+## Nonces
+
+Nonces are out of scope for this document simply because many service providers
+fail to implement them correctly, or do not adopt security specfiications
+because of the infrastructure complexity.  Given the `header` parameterization,
+a service provider is fully enabled to add nonce semantics into this scheme by
+using something like an `x-request-nonce` header, and ensuring it is signed
+with the `Date` header.
+
+## Clock Skew
+
+As the default scheme is to sign the `Date` header, service providers SHOULD
+protect against logged replay attacks by enforcing a clock skew.  The server
+SHOULD be synchronized with NTP, and the recommendation in this specification
+is to allow 300s of clock skew (in either direction).
+
+## Required Headers to Sign
+
+It is out of scope for this document to dictate what headers a service provider
+will want to enforce, but service providers SHOULD at minimum include the
+`Date` header.
+
+# References
+
+## Normative References
+
+* [RFC2616] Hypertext Transfer Protocol -- HTTP/1.1
+* [RFC2617] HTTP Authentication: Basic and Digest Access Authentication
+* [RFC5246] The Transport Layer Security (TLS) Protocol Version 1.2
+
+## Informative References
+
+    Name: Mark Cavage (editor)
+    Company: Joyent, Inc.
+    Email: mark.cavage@joyent.com
+    URI: http://www.joyent.com
+
+# Appendix A - Test Values
+
+The following test data uses the RSA (2048b) keys, which we will refer
+to as `keyId=Test` in the following samples:
+
+   -----BEGIN PUBLIC KEY-----
+   MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
+   6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
+   Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
+   oYi+1hqp1fIekaxsyQIDAQAB
+   -----END PUBLIC KEY-----
+
+    -----BEGIN RSA PRIVATE KEY-----
+    MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
+    NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
+    UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
+    AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
+    QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
+    kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
+    f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
+    412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
+    mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
+    kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
+    gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
+    G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
+    7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
+    -----END RSA PRIVATE KEY-----
+
+And all examples use this request:
+
+    POST /foo?param=value&pet=dog HTTP/1.1
+    Host: example.com
+    Date: Thu, 05 Jan 2012 21:31:40 GMT
+    Content-Type: application/json
+    Content-MD5: Sd/dVLAcvNLSq16eXua5uQ==
+    Content-Length: 18
+
+    {"hello": "world"}
+
+### Default
+
+The string to sign would be:
+
+    date: Thu, 05 Jan 2012 21:31:40 GMT
+
+The Authorization header would be:
+
+    Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="JldXnt8W9t643M2Sce10gqCh/+E7QIYLiI+bSjnFBGCti7s+mPPvOjVb72sbd1FjeOUwPTDpKbrQQORrm+xBYfAwCxF3LBSSzORvyJ5nRFCFxfJ3nlQD6Kdxhw8wrVZX5nSem4A/W3C8qH5uhFTRwF4ruRjh+ENHWuovPgO/HGQ="
+
+### All Headers
+
+Parameterized to include all headers, the string to sign would be (`+ "\n"`
+inserted for readability):
+
+    POST /foo?param=value&pet=dog HTTP/1.1 + "\n"
+    host: example.com + "\n"
+    date: Thu, 05 Jan 2012 21:31:40 GMT + "\n"
+    content-type: application/json + "\n"
+    content-md5: Sd/dVLAcvNLSq16eXua5uQ== + "\n"
+    content-length: 18
+
+The Authorization header would be:
+
+    Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="request-line host date content-type content-md5 content-length",signature="Gm7W/r+e90REDpWytALMrft4MqZxCmslOTOvwJX17ViEBA5E65QqvWI0vIH3l/vSsGiaMVmuUgzYsJLYMLcm5dGrv1+a+0fCoUdVKPZWHyImQEqpLkopVwqEH67LVECFBqFTAKlQgBn676zrfXQbb+b/VebAsNUtvQMe6cTjnDY="
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/index.js	(revision 487)
@@ -0,0 +1,25 @@
+// Copyright 2011 Joyent, Inc.  All rights reserved.
+
+var parser = require('./parser');
+var signer = require('./signer');
+var verify = require('./verify');
+var util = require('./util');
+
+
+
+///--- API
+
+module.exports = {
+
+  parse: parser.parseRequest,
+  parseRequest: parser.parseRequest,
+
+  sign: signer.signRequest,
+  signRequest: signer.signRequest,
+
+  sshKeyToPEM: util.sshKeyToPEM,
+  sshKeyFingerprint: util.fingerprint,
+
+  verify: verify.verifySignature,
+  verifySignature: verify.verifySignature
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/parser.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/parser.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/parser.js	(revision 487)
@@ -0,0 +1,304 @@
+// Copyright 2012 Joyent, Inc.  All rights reserved.
+
+var assert = require('assert-plus');
+var util = require('util');
+
+
+
+///--- Globals
+
+var Algorithms = {
+  'rsa-sha1': true,
+  'rsa-sha256': true,
+  'rsa-sha512': true,
+  'dsa-sha1': true,
+  'hmac-sha1': true,
+  'hmac-sha256': true,
+  'hmac-sha512': true
+};
+
+var State = {
+  New: 0,
+  Params: 1
+};
+
+var ParamsState = {
+  Name: 0,
+  Quote: 1,
+  Value: 2,
+  Comma: 3
+};
+
+
+
+///--- Specific Errors
+
+function HttpSignatureError(message, caller) {
+  if (Error.captureStackTrace)
+    Error.captureStackTrace(this, caller || HttpSignatureError);
+
+  this.message = message;
+  this.name = caller.name;
+}
+util.inherits(HttpSignatureError, Error);
+
+function ExpiredRequestError(message) {
+  HttpSignatureError.call(this, message, ExpiredRequestError);
+}
+util.inherits(ExpiredRequestError, HttpSignatureError);
+
+
+function InvalidHeaderError(message) {
+  HttpSignatureError.call(this, message, InvalidHeaderError);
+}
+util.inherits(InvalidHeaderError, HttpSignatureError);
+
+
+function InvalidParamsError(message) {
+  HttpSignatureError.call(this, message, InvalidParamsError);
+}
+util.inherits(InvalidParamsError, HttpSignatureError);
+
+
+function MissingHeaderError(message) {
+  HttpSignatureError.call(this, message, MissingHeaderError);
+}
+util.inherits(MissingHeaderError, HttpSignatureError);
+
+
+
+///--- Exported API
+
+module.exports = {
+
+  /**
+   * Parses the 'Authorization' header out of an http.ServerRequest object.
+   *
+   * Note that this API will fully validate the Authorization header, and throw
+   * on any error.  It will not however check the signature, or the keyId format
+   * as those are specific to your environment.  You can use the options object
+   * to pass in extra constraints.
+   *
+   * As a response object you can expect this:
+   *
+   *     {
+   *       "scheme": "Signature",
+   *       "params": {
+   *         "keyId": "foo",
+   *         "algorithm": "rsa-sha256",
+   *         "headers": [
+   *           "date" or "x-date",
+   *           "content-md5"
+   *         ],
+   *         "signature": "base64"
+   *       },
+   *       "signingString": "ready to be passed to crypto.verify()"
+   *     }
+   *
+   * @param {Object} request an http.ServerRequest.
+   * @param {Object} options an optional options object with:
+   *                   - clockSkew: allowed clock skew in seconds (default 300).
+   *                   - headers: required header names (def: date or x-date)
+   *                   - algorithms: algorithms to support (default: all).
+   * @return {Object} parsed out object (see above).
+   * @throws {TypeError} on invalid input.
+   * @throws {InvalidHeaderError} on an invalid Authorization header error.
+   * @throws {InvalidParamsError} if the params in the scheme are invalid.
+   * @throws {MissingHeaderError} if the params indicate a header not present,
+   *                              either in the request headers from the params,
+   *                              or not in the params from a required header
+   *                              in options.
+   * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
+   */
+  parseRequest: function parseRequest(request, options) {
+    assert.object(request, 'request');
+    assert.object(request.headers, 'request.headers');
+    if (options === undefined) {
+      options = {};
+    }
+    if (options.headers === undefined) {
+      options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
+    }
+    assert.object(options, 'options');
+    assert.arrayOfString(options.headers, 'options.headers');
+    assert.optionalNumber(options.clockSkew, 'options.clockSkew');
+
+    if (!request.headers.authorization)
+      throw new MissingHeaderError('no authorization header present in ' +
+                                   'the request');
+
+    options.clockSkew = options.clockSkew || 300;
+
+
+    var i = 0;
+    var state = State.New;
+    var substate = ParamsState.Name;
+    var tmpName = '';
+    var tmpValue = '';
+
+    var parsed = {
+      scheme: '',
+      params: {},
+      signingString: '',
+
+      get algorithm() {
+        return this.params.algorithm.toUpperCase();
+      },
+
+      get keyId() {
+        return this.params.keyId;
+      }
+
+    };
+
+    var authz = request.headers.authorization;
+    for (i = 0; i < authz.length; i++) {
+      var c = authz.charAt(i);
+
+      switch (Number(state)) {
+
+      case State.New:
+        if (c !== ' ') parsed.scheme += c;
+        else state = State.Params;
+        break;
+
+      case State.Params:
+        switch (Number(substate)) {
+
+        case ParamsState.Name:
+          var code = c.charCodeAt(0);
+          // restricted name of A-Z / a-z
+          if ((code >= 0x41 && code <= 0x5a) || // A-Z
+              (code >= 0x61 && code <= 0x7a)) { // a-z
+            tmpName += c;
+          } else if (c === '=') {
+            if (tmpName.length === 0)
+              throw new InvalidHeaderError('bad param format');
+            substate = ParamsState.Quote;
+          } else {
+            throw new InvalidHeaderError('bad param format');
+          }
+          break;
+
+        case ParamsState.Quote:
+          if (c === '"') {
+            tmpValue = '';
+            substate = ParamsState.Value;
+          } else {
+            throw new InvalidHeaderError('bad param format');
+          }
+          break;
+
+        case ParamsState.Value:
+          if (c === '"') {
+            parsed.params[tmpName] = tmpValue;
+            substate = ParamsState.Comma;
+          } else {
+            tmpValue += c;
+          }
+          break;
+
+        case ParamsState.Comma:
+          if (c === ',') {
+            tmpName = '';
+            substate = ParamsState.Name;
+          } else {
+            throw new InvalidHeaderError('bad param format');
+          }
+          break;
+
+        default:
+          throw new Error('Invalid substate');
+        }
+        break;
+
+      default:
+        throw new Error('Invalid substate');
+      }
+
+    }
+
+    if (!parsed.params.headers || parsed.params.headers === '') {
+      if (request.headers['x-date']) {
+        parsed.params.headers = ['x-date'];
+      } else {
+        parsed.params.headers = ['date'];
+      }
+    } else {
+      parsed.params.headers = parsed.params.headers.split(' ');
+    }
+
+    // Minimally validate the parsed object
+    if (!parsed.scheme || parsed.scheme !== 'Signature')
+      throw new InvalidHeaderError('scheme was not "Signature"');
+
+    if (!parsed.params.keyId)
+      throw new InvalidHeaderError('keyId was not specified');
+
+    if (!parsed.params.algorithm)
+      throw new InvalidHeaderError('algorithm was not specified');
+
+    if (!parsed.params.signature)
+      throw new InvalidHeaderError('signature was not specified');
+
+    // Check the algorithm against the official list
+    parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
+    if (!Algorithms[parsed.params.algorithm])
+      throw new InvalidParamsError(parsed.params.algorithm +
+                                   ' is not supported');
+
+    // Build the signingString
+    for (i = 0; i < parsed.params.headers.length; i++) {
+      var h = parsed.params.headers[i].toLowerCase();
+      parsed.params.headers[i] = h;
+
+      if (h !== 'request-line') {
+        var value = request.headers[h];
+        if (!value)
+          throw new MissingHeaderError(h + ' was not in the request');
+        parsed.signingString += h + ': ' + value;
+      } else {
+        parsed.signingString +=
+          request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
+      }
+
+      if ((i + 1) < parsed.params.headers.length)
+        parsed.signingString += '\n';
+    }
+
+    // Check against the constraints
+    var date;
+    if (request.headers.date || request.headers['x-date']) {
+        if (request.headers['x-date']) {
+          date = new Date(request.headers['x-date']);
+        } else {
+          date = new Date(request.headers.date);
+        }
+      var now = new Date();
+      var skew = Math.abs(now.getTime() - date.getTime());
+
+      if (skew > options.clockSkew * 1000) {
+        throw new ExpiredRequestError('clock skew of ' +
+                                      (skew / 1000) +
+                                      's was greater than ' +
+                                      options.clockSkew + 's');
+      }
+    }
+
+    options.headers.forEach(function (hdr) {
+      // Remember that we already checked any headers in the params
+      // were in the request, so if this passes we're good.
+      if (parsed.params.headers.indexOf(hdr) < 0)
+        throw new MissingHeaderError(hdr + ' was not a signed header');
+    });
+
+    if (options.algorithms) {
+      if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
+        throw new InvalidParamsError(parsed.params.algorithm +
+                                     ' is not a supported algorithm');
+    }
+
+    return parsed;
+  }
+
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/signer.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/signer.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/signer.js	(revision 487)
@@ -0,0 +1,179 @@
+// Copyright 2012 Joyent, Inc.  All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+var http = require('http');
+
+var sprintf = require('util').format;
+
+
+
+///--- Globals
+
+var Algorithms = {
+  'rsa-sha1': true,
+  'rsa-sha256': true,
+  'rsa-sha512': true,
+  'dsa-sha1': true,
+  'hmac-sha1': true,
+  'hmac-sha256': true,
+  'hmac-sha512': true
+};
+
+var Authorization =
+  'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
+
+
+
+///--- Specific Errors
+
+function MissingHeaderError(message) {
+    this.name = 'MissingHeaderError';
+    this.message = message;
+    this.stack = (new Error()).stack;
+}
+MissingHeaderError.prototype = new Error();
+
+
+function InvalidAlgorithmError(message) {
+    this.name = 'InvalidAlgorithmError';
+    this.message = message;
+    this.stack = (new Error()).stack;
+}
+InvalidAlgorithmError.prototype = new Error();
+
+
+
+///--- Internal Functions
+
+function _pad(val) {
+  if (parseInt(val, 10) < 10) {
+    val = '0' + val;
+  }
+  return val;
+}
+
+
+function _rfc1123() {
+  var date = new Date();
+
+  var months = ['Jan',
+                'Feb',
+                'Mar',
+                'Apr',
+                'May',
+                'Jun',
+                'Jul',
+                'Aug',
+                'Sep',
+                'Oct',
+                'Nov',
+                'Dec'];
+  var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
+  return days[date.getUTCDay()] + ', ' +
+    _pad(date.getUTCDate()) + ' ' +
+    months[date.getUTCMonth()] + ' ' +
+    date.getUTCFullYear() + ' ' +
+    _pad(date.getUTCHours()) + ':' +
+    _pad(date.getUTCMinutes()) + ':' +
+    _pad(date.getUTCSeconds()) +
+    ' GMT';
+}
+
+
+
+///--- Exported API
+
+module.exports = {
+
+  /**
+   * Adds an 'Authorization' header to an http.ClientRequest object.
+   *
+   * Note that this API will add a Date header if it's not already set. Any
+   * other headers in the options.headers array MUST be present, or this
+   * will throw.
+   *
+   * You shouldn't need to check the return type; it's just there if you want
+   * to be pedantic.
+   *
+   * @param {Object} request an instance of http.ClientRequest.
+   * @param {Object} options signing parameters object:
+   *                   - {String} keyId required.
+   *                   - {String} key required (either a PEM or HMAC key).
+   *                   - {Array} headers optional; defaults to ['date'].
+   *                   - {String} algorithm optional; defaults to 'rsa-sha256'.
+   *                   - {String} httpVersion optional; defaults to '1.1'.
+   * @return {Boolean} true if Authorization (and optionally Date) were added.
+   * @throws {TypeError} on bad parameter types (input).
+   * @throws {InvalidAlgorithmError} if algorithm was bad.
+   * @throws {MissingHeaderError} if a header to be signed was specified but
+   *                              was not present.
+   */
+  signRequest: function signRequest(request, options) {
+    assert.object(request, 'request');
+    assert.object(options, 'options');
+    assert.optionalString(options.algorithm, 'options.algorithm');
+    assert.string(options.keyId, 'options.keyId');
+    assert.optionalArrayOfString(options.headers, 'options.headers');
+    assert.optionalString(options.httpVersion, 'options.httpVersion');
+
+    if (!request.getHeader('Date'))
+      request.setHeader('Date', _rfc1123());
+    if (!options.headers)
+      options.headers = ['date'];
+    if (!options.algorithm)
+      options.algorithm = 'rsa-sha256';
+    if (!options.httpVersion)
+      options.httpVersion = '1.1';
+
+    options.algorithm = options.algorithm.toLowerCase();
+
+    if (!Algorithms[options.algorithm])
+      throw new InvalidAlgorithmError(options.algorithm + ' is not supported');
+
+    var i;
+    var stringToSign = '';
+    for (i = 0; i < options.headers.length; i++) {
+      if (typeof (options.headers[i]) !== 'string')
+        throw new TypeError('options.headers must be an array of Strings');
+
+      var h = options.headers[i].toLowerCase();
+
+      if (h !== 'request-line') {
+        var value = request.getHeader(h);
+        if (!value) {
+          throw new MissingHeaderError(h + ' was not in the request');
+        }
+        stringToSign += h + ': ' + value;
+      } else {
+        value =
+        stringToSign +=
+          request.method + ' ' + request.path + ' HTTP/' + options.httpVersion;
+      }
+
+      if ((i + 1) < options.headers.length)
+        stringToSign += '\n';
+    }
+
+    var alg = options.algorithm.match(/(hmac|rsa)-(\w+)/);
+    var signature;
+    if (alg[1] === 'hmac') {
+      var hmac = crypto.createHmac(alg[2].toUpperCase(), options.key);
+      hmac.update(stringToSign);
+      signature = hmac.digest('base64');
+    } else {
+      var signer = crypto.createSign(options.algorithm.toUpperCase());
+      signer.update(stringToSign);
+      signature = signer.sign(options.key, 'base64');
+    }
+
+    request.setHeader('Authorization', sprintf(Authorization,
+                                               options.keyId,
+                                               options.algorithm,
+                                               options.headers.join(' '),
+                                               signature));
+
+    return true;
+  }
+
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/util.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/util.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/util.js	(revision 487)
@@ -0,0 +1,249 @@
+// Copyright 2012 Joyent, Inc.  All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+
+var asn1 = require('asn1');
+var ctype = require('ctype');
+
+
+
+///--- Helpers
+
+function readNext(buffer, offset) {
+  var len = ctype.ruint32(buffer, 'big', offset);
+  offset += 4;
+
+  var newOffset = offset + len;
+
+  return {
+    data: buffer.slice(offset, newOffset),
+    offset: newOffset
+  };
+}
+
+
+function writeInt(writer, buffer) {
+  writer.writeByte(0x02); // ASN1.Integer
+  writer.writeLength(buffer.length);
+
+  for (var i = 0; i < buffer.length; i++)
+    writer.writeByte(buffer[i]);
+
+  return writer;
+}
+
+
+function rsaToPEM(key) {
+  var buffer;
+  var der;
+  var exponent;
+  var i;
+  var modulus;
+  var newKey = '';
+  var offset = 0;
+  var type;
+  var tmp;
+
+  try {
+    buffer = new Buffer(key.split(' ')[1], 'base64');
+
+    tmp = readNext(buffer, offset);
+    type = tmp.data.toString();
+    offset = tmp.offset;
+
+    if (type !== 'ssh-rsa')
+      throw new Error('Invalid ssh key type: ' + type);
+
+    tmp = readNext(buffer, offset);
+    exponent = tmp.data;
+    offset = tmp.offset;
+
+    tmp = readNext(buffer, offset);
+    modulus = tmp.data;
+  } catch (e) {
+    throw new Error('Invalid ssh key: ' + key);
+  }
+
+  // DER is a subset of BER
+  der = new asn1.BerWriter();
+
+  der.startSequence();
+
+  der.startSequence();
+  der.writeOID('1.2.840.113549.1.1.1');
+  der.writeNull();
+  der.endSequence();
+
+  der.startSequence(0x03); // bit string
+  der.writeByte(0x00);
+
+  // Actual key
+  der.startSequence();
+  writeInt(der, modulus);
+  writeInt(der, exponent);
+  der.endSequence();
+
+  // bit string
+  der.endSequence();
+
+  der.endSequence();
+
+  tmp = der.buffer.toString('base64');
+  for (i = 0; i < tmp.length; i++) {
+    if ((i % 64) === 0)
+      newKey += '\n';
+    newKey += tmp.charAt(i);
+  }
+
+  if (!/\\n$/.test(newKey))
+    newKey += '\n';
+
+  return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
+}
+
+
+function dsaToPEM(key) {
+  var buffer;
+  var offset = 0;
+  var tmp;
+  var der;
+  var newKey = '';
+
+  var type;
+  var p;
+  var q;
+  var g;
+  var y;
+
+  try {
+    buffer = new Buffer(key.split(' ')[1], 'base64');
+
+    tmp = readNext(buffer, offset);
+    type = tmp.data.toString();
+    offset = tmp.offset;
+
+    /* JSSTYLED */
+    if (!/^ssh-ds[as].*/.test(type))
+      throw new Error('Invalid ssh key type: ' + type);
+
+    tmp = readNext(buffer, offset);
+    p = tmp.data;
+    offset = tmp.offset;
+
+    tmp = readNext(buffer, offset);
+    q = tmp.data;
+    offset = tmp.offset;
+
+    tmp = readNext(buffer, offset);
+    g = tmp.data;
+    offset = tmp.offset;
+
+    tmp = readNext(buffer, offset);
+    y = tmp.data;
+  } catch (e) {
+    console.log(e.stack);
+    throw new Error('Invalid ssh key: ' + key);
+  }
+
+  // DER is a subset of BER
+  der = new asn1.BerWriter();
+
+  der.startSequence();
+
+  der.startSequence();
+  der.writeOID('1.2.840.10040.4.1');
+
+  der.startSequence();
+  writeInt(der, p);
+  writeInt(der, q);
+  writeInt(der, g);
+  der.endSequence();
+
+  der.endSequence();
+
+  der.startSequence(0x03); // bit string
+  der.writeByte(0x00);
+  writeInt(der, y);
+  der.endSequence();
+
+  der.endSequence();
+
+  tmp = der.buffer.toString('base64');
+  for (var i = 0; i < tmp.length; i++) {
+    if ((i % 64) === 0)
+      newKey += '\n';
+    newKey += tmp.charAt(i);
+  }
+
+  if (!/\\n$/.test(newKey))
+    newKey += '\n';
+
+  return '-----BEGIN PUBLIC KEY-----' + newKey + '-----END PUBLIC KEY-----\n';
+}
+
+
+///--- API
+
+module.exports = {
+
+  /**
+   * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
+   *
+   * The intent of this module is to interoperate with OpenSSL only,
+   * specifically the node crypto module's `verify` method.
+   *
+   * @param {String} key an OpenSSH public key.
+   * @return {String} PEM encoded form of the RSA public key.
+   * @throws {TypeError} on bad input.
+   * @throws {Error} on invalid ssh key formatted data.
+   */
+  sshKeyToPEM: function sshKeyToPEM(key) {
+    assert.string(key, 'ssh_key');
+
+    /* JSSTYLED */
+    if (/^ssh-rsa.*/.test(key))
+      return rsaToPEM(key);
+
+    /* JSSTYLED */
+    if (/^ssh-ds[as].*/.test(key))
+      return dsaToPEM(key);
+
+    throw new Error('Only RSA and DSA public keys are allowed');
+  },
+
+
+  /**
+   * Generates an OpenSSH fingerprint from an ssh public key.
+   *
+   * @param {String} key an OpenSSH public key.
+   * @return {String} key fingerprint.
+   * @throws {TypeError} on bad input.
+   * @throws {Error} if what you passed doesn't look like an ssh public key.
+   */
+  fingerprint: function fingerprint(key) {
+    assert.string(key, 'ssh_key');
+
+    var pieces = key.split(' ');
+    if (!pieces || !pieces.length || pieces.length < 2)
+      throw new Error('invalid ssh key');
+
+    var data = new Buffer(pieces[1], 'base64');
+
+    var hash = crypto.createHash('md5');
+    hash.update(data);
+    var digest = hash.digest('hex');
+
+    var fp = '';
+    for (var i = 0; i < digest.length; i++) {
+      if (i && i % 2 === 0)
+        fp += ':';
+
+      fp += digest[i];
+    }
+
+    return fp;
+  }
+
+
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/verify.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/verify.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/lib/verify.js	(revision 487)
@@ -0,0 +1,42 @@
+// Copyright 2011 Joyent, Inc.  All rights reserved.
+
+var assert = require('assert-plus');
+var crypto = require('crypto');
+
+
+
+///--- Exported API
+
+module.exports = {
+
+  /**
+   * Simply wraps up the node crypto operations for you, and returns
+   * true or false.  You are expected to pass in an object that was
+   * returned from `parse()`.
+   *
+   * @param {Object} parsedSignature the object you got from `parse`.
+   * @param {String} key either an RSA private key PEM or HMAC secret.
+   * @return {Boolean} true if valid, false otherwise.
+   * @throws {TypeError} if you pass in bad arguments.
+   */
+  verifySignature: function verifySignature(parsedSignature, key) {
+    assert.object(parsedSignature, 'parsedSignature');
+    assert.string(key, 'key');
+
+    var alg = parsedSignature.algorithm.match(/(HMAC|RSA|DSA)-(\w+)/);
+    if (!alg || alg.length !== 3)
+      throw new TypeError('parsedSignature: unsupported algorithm ' +
+                          parsedSignature.algorithm);
+
+    if (alg[1] === 'HMAC') {
+      var hmac = crypto.createHmac(alg[2].toUpperCase(), key);
+      hmac.update(parsedSignature.signingString);
+      return (hmac.digest('base64') === parsedSignature.params.signature);
+    } else {
+      var verify = crypto.createVerify(alg[0]);
+      verify.update(parsedSignature.signingString);
+      return verify.verify(key, parsedSignature.params.signature, 'base64');
+    }
+  }
+
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/.npmignore	(revision 487)
@@ -0,0 +1,2 @@
+node_modules
+*.log
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/LICENSE	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2011 Mark Cavage, All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/README.md	(revision 487)
@@ -0,0 +1,50 @@
+node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.
+Currently BER encoding is supported; at some point I'll likely have to do DER.
+
+## Usage
+
+Mostly, if you're *actually* needing to read and write ASN.1, you probably don't
+need this readme to explain what and why.  If you have no idea what ASN.1 is,
+see this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+The source is pretty much self-explanatory, and has read/write methods for the
+common types out there.
+
+### Decoding
+
+The following reads an ASN.1 sequence with a boolean.
+
+    var Ber = require('asn1').Ber;
+
+    var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
+
+    reader.readSequence();
+    console.log('Sequence len: ' + reader.length);
+    if (reader.peek() === Ber.Boolean)
+      console.log(reader.readBoolean());
+
+### Encoding
+
+The following generates the same payload as above.
+
+    var Ber = require('asn1').Ber;
+
+    var writer = new Ber.Writer();
+
+    writer.startSequence();
+    writer.writeBoolean(true);
+    writer.endSequence();
+
+    console.log(writer.buffer);
+
+## Installation
+
+    npm install asn1
+
+## License
+
+MIT.
+
+## Bugs
+
+See <https://github.com/mcavage/node-asn1/issues>.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/errors.js	(revision 487)
@@ -0,0 +1,13 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+
+module.exports = {
+
+  newInvalidAsn1Error: function(msg) {
+    var e = new Error();
+    e.name = 'InvalidAsn1Error';
+    e.message = msg || '';
+    return e;
+  }
+
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/index.js	(revision 487)
@@ -0,0 +1,27 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var errors = require('./errors');
+var types = require('./types');
+
+var Reader = require('./reader');
+var Writer = require('./writer');
+
+
+///--- Exports
+
+module.exports = {
+
+  Reader: Reader,
+
+  Writer: Writer
+
+};
+
+for (var t in types) {
+  if (types.hasOwnProperty(t))
+    module.exports[t] = types[t];
+}
+for (var e in errors) {
+  if (errors.hasOwnProperty(e))
+    module.exports[e] = errors[e];
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/reader.js	(revision 487)
@@ -0,0 +1,267 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var assert = require('assert');
+
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+///--- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+
+
+///--- API
+
+function Reader(data) {
+  if (!data || !Buffer.isBuffer(data))
+    throw new TypeError('data must be a node Buffer');
+
+  this._buf = data;
+  this._size = data.length;
+
+  // These hold the "current" state
+  this._len = 0;
+  this._offset = 0;
+
+  var self = this;
+  this.__defineGetter__('length', function() { return self._len; });
+  this.__defineGetter__('offset', function() { return self._offset; });
+  this.__defineGetter__('remain', function() {
+    return self._size - self._offset;
+  });
+  this.__defineGetter__('buffer', function() {
+    return self._buf.slice(self._offset);
+  });
+}
+
+
+/**
+ * Reads a single byte and advances offset; you can pass in `true` to make this
+ * a "peek" operation (i.e., get the byte, but don't advance the offset).
+ *
+ * @param {Boolean} peek true means don't move offset.
+ * @return {Number} the next byte, null if not enough data.
+ */
+Reader.prototype.readByte = function(peek) {
+  if (this._size - this._offset < 1)
+    return null;
+
+  var b = this._buf[this._offset] & 0xff;
+
+  if (!peek)
+    this._offset += 1;
+
+  return b;
+};
+
+
+Reader.prototype.peek = function() {
+  return this.readByte(true);
+};
+
+
+/**
+ * Reads a (potentially) variable length off the BER buffer.  This call is
+ * not really meant to be called directly, as callers have to manipulate
+ * the internal buffer afterwards.
+ *
+ * As a result of this call, you can call `Reader.length`, until the
+ * next thing called that does a readLength.
+ *
+ * @return {Number} the amount of offset to advance the buffer.
+ * @throws {InvalidAsn1Error} on bad ASN.1
+ */
+Reader.prototype.readLength = function(offset) {
+  if (offset === undefined)
+    offset = this._offset;
+
+  if (offset >= this._size)
+    return null;
+
+  var lenB = this._buf[offset++] & 0xff;
+  if (lenB === null)
+    return null;
+
+  if ((lenB & 0x80) == 0x80) {
+    lenB &= 0x7f;
+
+    if (lenB == 0)
+      throw newInvalidAsn1Error('Indefinite length not supported');
+
+    if (lenB > 4)
+      throw newInvalidAsn1Error('encoding too long');
+
+    if (this._size - offset < lenB)
+      return null;
+
+    this._len = 0;
+    for (var i = 0; i < lenB; i++)
+      this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
+
+  } else {
+    // Wasn't a variable length
+    this._len = lenB;
+  }
+
+  return offset;
+};
+
+
+/**
+ * Parses the next sequence in this BER buffer.
+ *
+ * To get the length of the sequence, call `Reader.length`.
+ *
+ * @return {Number} the sequence's tag.
+ */
+Reader.prototype.readSequence = function(tag) {
+  var seq = this.peek();
+  if (seq === null)
+    return null;
+  if (tag !== undefined && tag !== seq)
+    throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+                              ': got 0x' + seq.toString(16));
+
+  var o = this.readLength(this._offset + 1); // stored in `length`
+  if (o === null)
+    return null;
+
+  this._offset = o;
+  return seq;
+};
+
+
+Reader.prototype.readInt = function() {
+  return this._readTag(ASN1.Integer);
+};
+
+
+Reader.prototype.readBoolean = function() {
+  return (this._readTag(ASN1.Boolean) === 0 ? false : true);
+};
+
+
+Reader.prototype.readEnumeration = function() {
+  return this._readTag(ASN1.Enumeration);
+};
+
+
+Reader.prototype.readString = function(tag, retbuf) {
+  if (!tag)
+    tag = ASN1.OctetString;
+
+  var b = this.peek();
+  if (b === null)
+    return null;
+
+  if (b !== tag)
+    throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+                              ': got 0x' + b.toString(16));
+
+  var o = this.readLength(this._offset + 1); // stored in `length`
+
+  if (o === null)
+    return null;
+
+  if (this.length > this._size - o)
+    return null;
+
+  this._offset = o;
+
+  if (this.length === 0)
+    return '';
+
+  var str = this._buf.slice(this._offset, this._offset + this.length);
+  this._offset += this.length;
+
+  return retbuf ? str : str.toString('utf8');
+};
+
+Reader.prototype.readOID = function(tag) {
+  if (!tag)
+    tag = ASN1.OID;
+
+  var b = this.peek();
+  if (b === null)
+    return null;
+
+  if (b !== tag)
+    throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+                              ': got 0x' + b.toString(16));
+
+  var o = this.readLength(this._offset + 1); // stored in `length`
+  if (o === null)
+    return null;
+
+  if (this.length > this._size - o)
+    return null;
+
+  this._offset = o;
+
+  var values = [];
+  var value = 0;
+
+  for (var i = 0; i < this.length; i++) {
+    var byte = this._buf[this._offset++] & 0xff;
+
+    value <<= 7;
+    value += byte & 0x7f;
+    if ((byte & 0x80) == 0) {
+      values.push(value);
+      value = 0;
+    }
+  }
+
+  value = values.shift();
+  values.unshift(value % 40);
+  values.unshift((value / 40) >> 0);
+
+  return values.join('.');
+};
+
+
+Reader.prototype._readTag = function(tag) {
+  assert.ok(tag !== undefined);
+
+  var b = this.peek();
+
+  if (b === null)
+    return null;
+
+  if (b !== tag)
+    throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
+                              ': got 0x' + b.toString(16));
+
+  var o = this.readLength(this._offset + 1); // stored in `length`
+  if (o === null)
+    return null;
+
+  if (this.length > 4)
+    throw newInvalidAsn1Error('Integer too long: ' + this.length);
+
+  if (this.length > this._size - o)
+    return null;
+  this._offset = o;
+
+  var fb = this._buf[this._offset++];
+  var value = 0;
+
+  value = fb & 0x7F;
+  for (var i = 1; i < this.length; i++) {
+    value <<= 8;
+    value |= (this._buf[this._offset++] & 0xff);
+  }
+
+  if ((fb & 0x80) == 0x80)
+    value = -value;
+
+  return value;
+};
+
+
+
+///--- Exported API
+
+module.exports = Reader;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/types.js	(revision 487)
@@ -0,0 +1,36 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+
+module.exports = {
+  EOC: 0,
+  Boolean: 1,
+  Integer: 2,
+  BitString: 3,
+  OctetString: 4,
+  Null: 5,
+  OID: 6,
+  ObjectDescriptor: 7,
+  External: 8,
+  Real: 9, // float
+  Enumeration: 10,
+  PDV: 11,
+  Utf8String: 12,
+  RelativeOID: 13,
+  Sequence: 16,
+  Set: 17,
+  NumericString: 18,
+  PrintableString: 19,
+  T61String: 20,
+  VideotexString: 21,
+  IA5String: 22,
+  UTCTime: 23,
+  GeneralizedTime: 24,
+  GraphicString: 25,
+  VisibleString: 26,
+  GeneralString: 28,
+  UniversalString: 29,
+  CharacterString: 30,
+  BMPString: 31,
+  Constructor: 32,
+  Context: 128
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/ber/writer.js	(revision 487)
@@ -0,0 +1,317 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var assert = require('assert');
+var ASN1 = require('./types');
+var errors = require('./errors');
+
+
+///--- Globals
+
+var newInvalidAsn1Error = errors.newInvalidAsn1Error;
+
+var DEFAULT_OPTS = {
+  size: 1024,
+  growthFactor: 8
+};
+
+
+///--- Helpers
+
+function merge(from, to) {
+  assert.ok(from);
+  assert.equal(typeof(from), 'object');
+  assert.ok(to);
+  assert.equal(typeof(to), 'object');
+
+  var keys = Object.getOwnPropertyNames(from);
+  keys.forEach(function(key) {
+    if (to[key])
+      return;
+
+    var value = Object.getOwnPropertyDescriptor(from, key);
+    Object.defineProperty(to, key, value);
+  });
+
+  return to;
+}
+
+
+
+///--- API
+
+function Writer(options) {
+  options = merge(DEFAULT_OPTS, options || {});
+
+  this._buf = new Buffer(options.size || 1024);
+  this._size = this._buf.length;
+  this._offset = 0;
+  this._options = options;
+
+  // A list of offsets in the buffer where we need to insert
+  // sequence tag/len pairs.
+  this._seq = [];
+
+  var self = this;
+  this.__defineGetter__('buffer', function() {
+    if (self._seq.length)
+      throw new InvalidAsn1Error(self._seq.length + ' unended sequence(s)');
+
+    return self._buf.slice(0, self._offset);
+  });
+}
+
+
+Writer.prototype.writeByte = function(b) {
+  if (typeof(b) !== 'number')
+    throw new TypeError('argument must be a Number');
+
+  this._ensure(1);
+  this._buf[this._offset++] = b;
+};
+
+
+Writer.prototype.writeInt = function(i, tag) {
+  if (typeof(i) !== 'number')
+    throw new TypeError('argument must be a Number');
+  if (typeof(tag) !== 'number')
+    tag = ASN1.Integer;
+
+  var sz = 4;
+
+  while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000)) &&
+         (sz > 1)) {
+    sz--;
+    i <<= 8;
+  }
+
+  if (sz > 4)
+    throw new InvalidAsn1Error('BER ints cannot be > 0xffffffff');
+
+  this._ensure(2 + sz);
+  this._buf[this._offset++] = tag;
+  this._buf[this._offset++] = sz;
+
+  while (sz-- > 0) {
+    this._buf[this._offset++] = ((i & 0xff000000) >> 24);
+    i <<= 8;
+  }
+
+};
+
+
+Writer.prototype.writeNull = function() {
+  this.writeByte(ASN1.Null);
+  this.writeByte(0x00);
+};
+
+
+Writer.prototype.writeEnumeration = function(i, tag) {
+  if (typeof(i) !== 'number')
+    throw new TypeError('argument must be a Number');
+  if (typeof(tag) !== 'number')
+    tag = ASN1.Enumeration;
+
+  return this.writeInt(i, tag);
+};
+
+
+Writer.prototype.writeBoolean = function(b, tag) {
+  if (typeof(b) !== 'boolean')
+    throw new TypeError('argument must be a Boolean');
+  if (typeof(tag) !== 'number')
+    tag = ASN1.Boolean;
+
+  this._ensure(3);
+  this._buf[this._offset++] = tag;
+  this._buf[this._offset++] = 0x01;
+  this._buf[this._offset++] = b ? 0xff : 0x00;
+};
+
+
+Writer.prototype.writeString = function(s, tag) {
+  if (typeof(s) !== 'string')
+    throw new TypeError('argument must be a string (was: ' + typeof(s) + ')');
+  if (typeof(tag) !== 'number')
+    tag = ASN1.OctetString;
+
+  var len = Buffer.byteLength(s);
+  this.writeByte(tag);
+  this.writeLength(len);
+  if (len) {
+    this._ensure(len);
+    this._buf.write(s, this._offset);
+    this._offset += len;
+  }
+};
+
+
+Writer.prototype.writeBuffer = function(buf, tag) {
+  if (typeof(tag) !== 'number')
+    throw new TypeError('tag must be a number');
+  if (!Buffer.isBuffer(buf))
+    throw new TypeError('argument must be a buffer');
+
+  this.writeByte(tag);
+  this.writeLength(buf.length);
+  this._ensure(buf.length);
+  buf.copy(this._buf, this._offset, 0, buf.length);
+  this._offset += buf.length;
+};
+
+
+Writer.prototype.writeStringArray = function(strings) {
+  if ((!strings instanceof Array))
+    throw new TypeError('argument must be an Array[String]');
+
+  var self = this;
+  strings.forEach(function(s) {
+    self.writeString(s);
+  });
+};
+
+// This is really to solve DER cases, but whatever for now
+Writer.prototype.writeOID = function(s, tag) {
+  if (typeof(s) !== 'string')
+    throw new TypeError('argument must be a string');
+  if (typeof(tag) !== 'number')
+    tag = ASN1.OID;
+
+  if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
+    throw new Error('argument is not a valid OID string');
+
+  function encodeOctet(bytes, octet) {
+    if (octet < 128) {
+        bytes.push(octet);
+    } else if (octet < 16384) {
+        bytes.push((octet >>> 7) | 0x80);
+        bytes.push(octet & 0x7F);
+    } else if (octet < 2097152) {
+      bytes.push((octet >>> 14) | 0x80);
+      bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+      bytes.push(octet & 0x7F);
+    } else if (octet < 268435456) {
+      bytes.push((octet >>> 21) | 0x80);
+      bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+      bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+      bytes.push(octet & 0x7F);
+    } else {
+      bytes.push(((octet >>> 28) | 0x80) & 0xFF);
+      bytes.push(((octet >>> 21) | 0x80) & 0xFF);
+      bytes.push(((octet >>> 14) | 0x80) & 0xFF);
+      bytes.push(((octet >>> 7) | 0x80) & 0xFF);
+      bytes.push(octet & 0x7F);
+    }
+  }
+
+  var tmp = s.split('.');
+  var bytes = [];
+  bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
+  tmp.slice(2).forEach(function(b) {
+    encodeOctet(bytes, parseInt(b, 10));
+  });
+
+  var self = this;
+  this._ensure(2 + bytes.length);
+  this.writeByte(tag);
+  this.writeLength(bytes.length);
+  bytes.forEach(function(b) {
+    self.writeByte(b);
+  });
+};
+
+
+Writer.prototype.writeLength = function(len) {
+  if (typeof(len) !== 'number')
+    throw new TypeError('argument must be a Number');
+
+  this._ensure(4);
+
+  if (len <= 0x7f) {
+    this._buf[this._offset++] = len;
+  } else if (len <= 0xff) {
+    this._buf[this._offset++] = 0x81;
+    this._buf[this._offset++] = len;
+  } else if (len <= 0xffff) {
+    this._buf[this._offset++] = 0x82;
+    this._buf[this._offset++] = len >> 8;
+    this._buf[this._offset++] = len;
+  } else if (len <= 0xffffff) {
+    this._shift(start, len, 1);
+    this._buf[this._offset++] = 0x83;
+    this._buf[this._offset++] = len >> 16;
+    this._buf[this._offset++] = len >> 8;
+    this._buf[this._offset++] = len;
+  } else {
+    throw new InvalidAsn1ERror('Length too long (> 4 bytes)');
+  }
+};
+
+Writer.prototype.startSequence = function(tag) {
+  if (typeof(tag) !== 'number')
+    tag = ASN1.Sequence | ASN1.Constructor;
+
+  this.writeByte(tag);
+  this._seq.push(this._offset);
+  this._ensure(3);
+  this._offset += 3;
+};
+
+
+Writer.prototype.endSequence = function() {
+  var seq = this._seq.pop();
+  var start = seq + 3;
+  var len = this._offset - start;
+
+  if (len <= 0x7f) {
+    this._shift(start, len, -2);
+    this._buf[seq] = len;
+  } else if (len <= 0xff) {
+    this._shift(start, len, -1);
+    this._buf[seq] = 0x81;
+    this._buf[seq + 1] = len;
+  } else if (len <= 0xffff) {
+    this._buf[seq] = 0x82;
+    this._buf[seq + 1] = len >> 8;
+    this._buf[seq + 2] = len;
+  } else if (len <= 0xffffff) {
+    this._shift(start, len, 1);
+    this._buf[seq] = 0x83;
+    this._buf[seq + 1] = len >> 16;
+    this._buf[seq + 2] = len >> 8;
+    this._buf[seq + 3] = len;
+  } else {
+    throw new InvalidAsn1Error('Sequence too long');
+  }
+};
+
+
+Writer.prototype._shift = function(start, len, shift) {
+  assert.ok(start !== undefined);
+  assert.ok(len !== undefined);
+  assert.ok(shift);
+
+  this._buf.copy(this._buf, start + shift, start, start + len);
+  this._offset += shift;
+};
+
+Writer.prototype._ensure = function(len) {
+  assert.ok(len);
+
+  if (this._size - this._offset < len) {
+    var sz = this._size * this._options.growthFactor;
+    if (sz - this._offset < len)
+      sz += len;
+
+    var buf = new Buffer(sz);
+
+    this._buf.copy(buf, 0, 0, this._offset);
+    this._buf = buf;
+    this._size = sz;
+  }
+};
+
+
+
+///--- Exported API
+
+module.exports = Writer;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/lib/index.js	(revision 487)
@@ -0,0 +1,20 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+// If you have no idea what ASN.1 or BER is, see this:
+// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
+
+var Ber = require('./ber/index');
+
+
+
+///--- Exported API
+
+module.exports = {
+
+  Ber: Ber,
+
+  BerReader: Ber.Reader,
+
+  BerWriter: Ber.Writer
+
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/package.json	(revision 487)
@@ -0,0 +1,47 @@
+{
+  "author": {
+    "name": "Mark Cavage",
+    "email": "mcavage@gmail.com"
+  },
+  "contributors": [
+    {
+      "name": "David Gwynne",
+      "email": "loki@animata.net"
+    },
+    {
+      "name": "Yunong Xiao",
+      "email": "yunong@joyent.com"
+    }
+  ],
+  "name": "asn1",
+  "description": "Contains parsers and serializers for ASN.1 (currently BER only)",
+  "version": "0.1.11",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/mcavage/node-asn1.git"
+  },
+  "main": "lib/index.js",
+  "engines": {
+    "node": ">=0.4.9"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "tap": "0.1.4"
+  },
+  "scripts": {
+    "pretest": "which gjslint; if [[ \"$?\" = 0 ]] ; then  gjslint --nojsdoc -r lib -r tst; else echo \"Missing gjslint. Skipping lint\"; fi",
+    "test": "tap ./tst"
+  },
+  "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why.  If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n    var Ber = require('asn1').Ber;\n\n    var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n    reader.readSequence();\n    console.log('Sequence len: ' + reader.length);\n    if (reader.peek() === Ber.Boolean)\n      console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n    var Ber = require('asn1').Ber;\n\n    var writer = new Ber.Writer();\n\n    writer.startSequence();\n    writer.writeBoolean(true);\n    writer.endSequence();\n\n    console.log(writer.buffer);\n\n## Installation\n\n    npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-asn1/issues>.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/mcavage/node-asn1/issues"
+  },
+  "homepage": "https://github.com/mcavage/node-asn1",
+  "_id": "asn1@0.1.11",
+  "dist": {
+    "shasum": "fbbb4e0c892ea47308ff4a0e90cc4aac37e44a38"
+  },
+  "_from": "asn1@0.1.11",
+  "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.1.11.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/reader.test.js	(revision 487)
@@ -0,0 +1,172 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var test = require('tap').test;
+
+
+
+///--- Globals
+
+var BerReader;
+
+
+
+///--- Tests
+
+test('load library', function(t) {
+  BerReader = require('../../lib/index').BerReader;
+  t.ok(BerReader);
+  try {
+    new BerReader();
+    t.fail('Should have thrown');
+  } catch (e) {
+    t.ok(e instanceof TypeError, 'Should have been a type error');
+  }
+  t.end();
+});
+
+
+test('read byte', function(t) {
+  var reader = new BerReader(new Buffer([0xde]));
+  t.ok(reader);
+  t.equal(reader.readByte(), 0xde, 'wrong value');
+  t.end();
+});
+
+
+test('read 1 byte int', function(t) {
+  var reader = new BerReader(new Buffer([0x02, 0x01, 0x03]));
+  t.ok(reader);
+  t.equal(reader.readInt(), 0x03, 'wrong value');
+  t.equal(reader.length, 0x01, 'wrong length');
+  t.end();
+});
+
+
+test('read 2 byte int', function(t) {
+  var reader = new BerReader(new Buffer([0x02, 0x02, 0x7e, 0xde]));
+  t.ok(reader);
+  t.equal(reader.readInt(), 0x7ede, 'wrong value');
+  t.equal(reader.length, 0x02, 'wrong length');
+  t.end();
+});
+
+
+test('read 3 byte int', function(t) {
+  var reader = new BerReader(new Buffer([0x02, 0x03, 0x7e, 0xde, 0x03]));
+  t.ok(reader);
+  t.equal(reader.readInt(), 0x7ede03, 'wrong value');
+  t.equal(reader.length, 0x03, 'wrong length');
+  t.end();
+});
+
+
+test('read 4 byte int', function(t) {
+  var reader = new BerReader(new Buffer([0x02, 0x04, 0x7e, 0xde, 0x03, 0x01]));
+  t.ok(reader);
+  t.equal(reader.readInt(), 0x7ede0301, 'wrong value');
+  t.equal(reader.length, 0x04, 'wrong length');
+  t.end();
+});
+
+
+test('read boolean true', function(t) {
+  var reader = new BerReader(new Buffer([0x01, 0x01, 0xff]));
+  t.ok(reader);
+  t.equal(reader.readBoolean(), true, 'wrong value');
+  t.equal(reader.length, 0x01, 'wrong length');
+  t.end();
+});
+
+
+test('read boolean false', function(t) {
+  var reader = new BerReader(new Buffer([0x01, 0x01, 0x00]));
+  t.ok(reader);
+  t.equal(reader.readBoolean(), false, 'wrong value');
+  t.equal(reader.length, 0x01, 'wrong length');
+  t.end();
+});
+
+
+test('read enumeration', function(t) {
+  var reader = new BerReader(new Buffer([0x0a, 0x01, 0x20]));
+  t.ok(reader);
+  t.equal(reader.readEnumeration(), 0x20, 'wrong value');
+  t.equal(reader.length, 0x01, 'wrong length');
+  t.end();
+});
+
+
+test('read string', function(t) {
+  var dn = 'cn=foo,ou=unit,o=test';
+  var buf = new Buffer(dn.length + 2);
+  buf[0] = 0x04;
+  buf[1] = Buffer.byteLength(dn);
+  buf.write(dn, 2);
+  var reader = new BerReader(buf);
+  t.ok(reader);
+  t.equal(reader.readString(), dn, 'wrong value');
+  t.equal(reader.length, dn.length, 'wrong length');
+  t.end();
+});
+
+
+test('read sequence', function(t) {
+  var reader = new BerReader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));
+  t.ok(reader);
+  t.equal(reader.readSequence(), 0x30, 'wrong value');
+  t.equal(reader.length, 0x03, 'wrong length');
+  t.equal(reader.readBoolean(), true, 'wrong value');
+  t.equal(reader.length, 0x01, 'wrong length');
+  t.end();
+});
+
+
+test('anonymous LDAPv3 bind', function(t) {
+  var BIND = new Buffer(14);
+  BIND[0] = 0x30;  // Sequence
+  BIND[1] = 12;    // len
+  BIND[2] = 0x02;  // ASN.1 Integer
+  BIND[3] = 1;     // len
+  BIND[4] = 0x04;  // msgid (make up 4)
+  BIND[5] = 0x60;  // Bind Request
+  BIND[6] = 7;     // len
+  BIND[7] = 0x02;  // ASN.1 Integer
+  BIND[8] = 1;     // len
+  BIND[9] = 0x03;  // v3
+  BIND[10] = 0x04; // String (bind dn)
+  BIND[11] = 0;    // len
+  BIND[12] = 0x80; // ContextSpecific (choice)
+  BIND[13] = 0;    // simple bind
+
+  // Start testing ^^
+  var ber = new BerReader(BIND);
+  t.equal(ber.readSequence(), 48, 'Not an ASN.1 Sequence');
+  t.equal(ber.length, 12, 'Message length should be 12');
+  t.equal(ber.readInt(), 4, 'Message id should have been 4');
+  t.equal(ber.readSequence(), 96, 'Bind Request should have been 96');
+  t.equal(ber.length, 7, 'Bind length should have been 7');
+  t.equal(ber.readInt(), 3, 'LDAP version should have been 3');
+  t.equal(ber.readString(), '', 'Bind DN should have been empty');
+  t.equal(ber.length, 0, 'string length should have been 0');
+  t.equal(ber.readByte(), 0x80, 'Should have been ContextSpecific (choice)');
+  t.equal(ber.readByte(), 0, 'Should have been simple bind');
+  t.equal(null, ber.readByte(), 'Should be out of data');
+  t.end();
+});
+
+
+test('long string', function(t) {
+  var buf = new Buffer(256);
+  var o;
+  var s =
+    '2;649;CN=Red Hat CS 71GA Demo,O=Red Hat CS 71GA Demo,C=US;' +
+    'CN=RHCS Agent - admin01,UID=admin01,O=redhat,C=US [1] This is ' +
+    'Teena Vradmin\'s description.';
+  buf[0] = 0x04;
+  buf[1] = 0x81;
+  buf[2] = 0x94;
+  buf.write(s, 3);
+  var ber = new BerReader(buf.slice(0, 3 + s.length));
+  t.equal(ber.readString(), s);
+  t.end();
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/asn1/tst/ber/writer.test.js	(revision 487)
@@ -0,0 +1,296 @@
+// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
+
+var test = require('tap').test;
+var sys = require('sys');
+
+///--- Globals
+
+var BerWriter;
+
+var BerReader;
+
+
+///--- Tests
+
+test('load library', function(t) {
+  BerWriter = require('../../lib/index').BerWriter;
+  t.ok(BerWriter);
+  t.ok(new BerWriter());
+  t.end();
+});
+
+
+test('write byte', function(t) {
+  var writer = new BerWriter();
+
+  writer.writeByte(0xC2);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 1, 'Wrong length');
+  t.equal(ber[0], 0xC2, 'value wrong');
+
+  t.end();
+});
+
+
+test('write 1 byte int', function(t) {
+  var writer = new BerWriter();
+
+  writer.writeInt(0x7f);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 3, 'Wrong length for an int: ' + ber.length);
+  t.equal(ber[0], 0x02, 'ASN.1 tag wrong (2) -> ' + ber[0]);
+  t.equal(ber[1], 0x01, 'length wrong(1) -> ' + ber[1]);
+  t.equal(ber[2], 0x7f, 'value wrong(3) -> ' + ber[2]);
+
+  t.end();
+});
+
+
+test('write 2 byte int', function(t) {
+  var writer = new BerWriter();
+
+  writer.writeInt(0x7ffe);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 4, 'Wrong length for an int');
+  t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
+  t.equal(ber[1], 0x02, 'length wrong');
+  t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
+  t.equal(ber[3], 0xfe, 'value wrong (byte 2)');
+
+  t.end();
+});
+
+
+test('write 3 byte int', function(t) {
+  var writer = new BerWriter();
+
+  writer.writeInt(0x7ffffe);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 5, 'Wrong length for an int');
+  t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
+  t.equal(ber[1], 0x03, 'length wrong');
+  t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
+  t.equal(ber[3], 0xff, 'value wrong (byte 2)');
+  t.equal(ber[4], 0xfe, 'value wrong (byte 3)');
+
+  t.end();
+});
+
+
+test('write 4 byte int', function(t) {
+  var writer = new BerWriter();
+
+  writer.writeInt(0x7ffffffe);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+
+  t.equal(ber.length, 6, 'Wrong length for an int');
+  t.equal(ber[0], 0x02, 'ASN.1 tag wrong');
+  t.equal(ber[1], 0x04, 'length wrong');
+  t.equal(ber[2], 0x7f, 'value wrong (byte 1)');
+  t.equal(ber[3], 0xff, 'value wrong (byte 2)');
+  t.equal(ber[4], 0xff, 'value wrong (byte 3)');
+  t.equal(ber[5], 0xfe, 'value wrong (byte 4)');
+
+  t.end();
+});
+
+
+test('write boolean', function(t) {
+  var writer = new BerWriter();
+
+  writer.writeBoolean(true);
+  writer.writeBoolean(false);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 6, 'Wrong length');
+  t.equal(ber[0], 0x01, 'tag wrong');
+  t.equal(ber[1], 0x01, 'length wrong');
+  t.equal(ber[2], 0xff, 'value wrong');
+  t.equal(ber[3], 0x01, 'tag wrong');
+  t.equal(ber[4], 0x01, 'length wrong');
+  t.equal(ber[5], 0x00, 'value wrong');
+
+  t.end();
+});
+
+
+test('write string', function(t) {
+  var writer = new BerWriter();
+  writer.writeString('hello world');
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 13, 'wrong length');
+  t.equal(ber[0], 0x04, 'wrong tag');
+  t.equal(ber[1], 11, 'wrong length');
+  t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
+
+  t.end();
+});
+
+test('write buffer', function(t) {
+  var writer = new BerWriter();
+  // write some stuff to start with
+  writer.writeString('hello world');
+  var ber = writer.buffer;
+  var buf = new Buffer([0x04, 0x0b, 0x30, 0x09, 0x02, 0x01, 0x0f, 0x01, 0x01,
+     0xff, 0x01, 0x01, 0xff]);
+  writer.writeBuffer(buf.slice(2, buf.length), 0x04);
+  ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 26, 'wrong length');
+  t.equal(ber[0], 0x04, 'wrong tag');
+  t.equal(ber[1], 11, 'wrong length');
+  t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
+  t.equal(ber[13], buf[0], 'wrong tag');
+  t.equal(ber[14], buf[1], 'wrong length');
+  for (var i = 13, j = 0; i < ber.length && j < buf.length; i++, j++) {
+    t.equal(ber[i], buf[j], 'buffer contents not identical');
+  }
+  t.end();
+});
+
+test('write string array', function(t) {
+  var writer = new BerWriter();
+  writer.writeStringArray(['hello world', 'fubar!']);
+  var ber = writer.buffer;
+
+  t.ok(ber);
+
+  t.equal(ber.length, 21, 'wrong length');
+  t.equal(ber[0], 0x04, 'wrong tag');
+  t.equal(ber[1], 11, 'wrong length');
+  t.equal(ber.slice(2, 13).toString('utf8'), 'hello world', 'wrong value');
+
+  t.equal(ber[13], 0x04, 'wrong tag');
+  t.equal(ber[14], 6, 'wrong length');
+  t.equal(ber.slice(15).toString('utf8'), 'fubar!', 'wrong value');
+
+  t.end();
+});
+
+
+test('resize internal buffer', function(t) {
+  var writer = new BerWriter({size: 2});
+  writer.writeString('hello world');
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 13, 'wrong length');
+  t.equal(ber[0], 0x04, 'wrong tag');
+  t.equal(ber[1], 11, 'wrong length');
+  t.equal(ber.slice(2).toString('utf8'), 'hello world', 'wrong value');
+
+  t.end();
+});
+
+
+test('sequence', function(t) {
+  var writer = new BerWriter({size: 25});
+  writer.startSequence();
+  writer.writeString('hello world');
+  writer.endSequence();
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  console.log(ber);
+  t.equal(ber.length, 15, 'wrong length');
+  t.equal(ber[0], 0x30, 'wrong tag');
+  t.equal(ber[1], 13, 'wrong length');
+  t.equal(ber[2], 0x04, 'wrong tag');
+  t.equal(ber[3], 11, 'wrong length');
+  t.equal(ber.slice(4).toString('utf8'), 'hello world', 'wrong value');
+
+  t.end();
+});
+
+
+test('nested sequence', function(t) {
+  var writer = new BerWriter({size: 25});
+  writer.startSequence();
+  writer.writeString('hello world');
+  writer.startSequence();
+  writer.writeString('hello world');
+  writer.endSequence();
+  writer.endSequence();
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 30, 'wrong length');
+  t.equal(ber[0], 0x30, 'wrong tag');
+  t.equal(ber[1], 28, 'wrong length');
+  t.equal(ber[2], 0x04, 'wrong tag');
+  t.equal(ber[3], 11, 'wrong length');
+  t.equal(ber.slice(4, 15).toString('utf8'), 'hello world', 'wrong value');
+  t.equal(ber[15], 0x30, 'wrong tag');
+  t.equal(ber[16], 13, 'wrong length');
+  t.equal(ber[17], 0x04, 'wrong tag');
+  t.equal(ber[18], 11, 'wrong length');
+  t.equal(ber.slice(19, 30).toString('utf8'), 'hello world', 'wrong value');
+
+  t.end();
+});
+
+
+test('LDAP bind message', function(t) {
+  var dn = 'cn=foo,ou=unit,o=test';
+  var writer = new BerWriter();
+  writer.startSequence();
+  writer.writeInt(3);             // msgid = 3
+  writer.startSequence(0x60);     // ldap bind
+  writer.writeInt(3);             // ldap v3
+  writer.writeString(dn);
+  writer.writeByte(0x80);
+  writer.writeByte(0x00);
+  writer.endSequence();
+  writer.endSequence();
+  var ber = writer.buffer;
+
+  t.ok(ber);
+  t.equal(ber.length, 35, 'wrong length (buffer)');
+  t.equal(ber[0], 0x30, 'wrong tag');
+  t.equal(ber[1], 33, 'wrong length');
+  t.equal(ber[2], 0x02, 'wrong tag');
+  t.equal(ber[3], 1, 'wrong length');
+  t.equal(ber[4], 0x03, 'wrong value');
+  t.equal(ber[5], 0x60, 'wrong tag');
+  t.equal(ber[6], 28, 'wrong length');
+  t.equal(ber[7], 0x02, 'wrong tag');
+  t.equal(ber[8], 1, 'wrong length');
+  t.equal(ber[9], 0x03, 'wrong value');
+  t.equal(ber[10], 0x04, 'wrong tag');
+  t.equal(ber[11], dn.length, 'wrong length');
+  t.equal(ber.slice(12, 33).toString('utf8'), dn, 'wrong value');
+  t.equal(ber[33], 0x80, 'wrong tag');
+  t.equal(ber[34], 0x00, 'wrong len');
+
+  t.end();
+});
+
+
+test('Write OID', function(t) {
+  var oid = '1.2.840.113549.1.1.1';
+  var writer = new BerWriter();
+  writer.writeOID(oid);
+
+  var ber = writer.buffer;
+  t.ok(ber);
+  console.log(require('util').inspect(ber));
+  console.log(require('util').inspect(new Buffer([0x06, 0x09, 0x2a, 0x86,
+                                                  0x48, 0x86, 0xf7, 0x0d,
+                                                  0x01, 0x01, 0x01])));
+
+  t.end();
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md	(revision 487)
@@ -0,0 +1,126 @@
+# node-assert-plus
+
+This library is a super small wrapper over node's assert module that has two
+things: (1) the ability to disable assertions with the environment variable
+NODE_NDEBUG, and (2) some API wrappers for argument testing.  Like
+`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks
+like this:
+
+    var assert = require('assert-plus');
+
+    function fooAccount(options, callback) {
+	    assert.object(options, 'options');
+		assert.number(options.id, 'options.id);
+		assert.bool(options.isManager, 'options.isManager');
+		assert.string(options.name, 'options.name');
+		assert.arrayOfString(options.email, 'options.email');
+		assert.func(callback, 'callback');
+
+        // Do stuff
+		callback(null, {});
+    }
+
+# API
+
+All methods that *aren't* part of node's core assert API are simply assumed to
+take an argument, and then a string 'name' that's not a message; `AssertionError`
+will be thrown if the assertion fails with a message like:
+
+    AssertionError: foo (string) is required
+	at test (/home/mark/work/foo/foo.js:3:9)
+	at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
+	at Module._compile (module.js:446:26)
+	at Object..js (module.js:464:10)
+	at Module.load (module.js:353:31)
+	at Function._load (module.js:311:12)
+	at Array.0 (module.js:484:10)
+	at EventEmitter._tickCallback (node.js:190:38)
+
+from:
+
+    function test(foo) {
+	    assert.string(foo, 'foo');
+    }
+
+There you go.  You can check that arrays are of a homogenous type with `Arrayof$Type`:
+
+    function test(foo) {
+	    assert.arrayOfString(foo, 'foo');
+    }
+
+You can assert IFF an argument is not `undefined` (i.e., an optional arg):
+
+    assert.optionalString(foo, 'foo');
+
+Lastly, you can opt-out of assertion checking altogether by setting the
+environment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have
+lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
+production.
+
+The complete list of APIs is:
+
+* assert.bool
+* assert.buffer
+* assert.func
+* assert.number
+* assert.object
+* assert.string
+* assert.arrayOfBool
+* assert.arrayOfFunc
+* assert.arrayOfNumber
+* assert.arrayOfObject
+* assert.arrayOfString
+* assert.optionalBool
+* assert.optionalBuffer
+* assert.optionalFunc
+* assert.optionalNumber
+* assert.optionalObject
+* assert.optionalString
+* assert.optionalArrayOfBool
+* assert.optionalArrayOfFunc
+* assert.optionalArrayOfNumber
+* assert.optionalArrayOfObject
+* assert.optionalArrayOfString
+* assert.AssertionError
+* assert.fail
+* assert.ok
+* assert.equal
+* assert.notEqual
+* assert.deepEqual
+* assert.notDeepEqual
+* assert.strictEqual
+* assert.notStrictEqual
+* assert.throws
+* assert.doesNotThrow
+* assert.ifError
+
+# Installation
+
+    npm install assert-plus
+
+## License
+
+The MIT License (MIT)
+Copyright (c) 2012 Mark Cavage
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+## Bugs
+
+See <https://github.com/mcavage/node-assert-plus/issues>.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js	(revision 487)
@@ -0,0 +1,196 @@
+// Copyright (c) 2012, Mark Cavage. All rights reserved.
+
+var assert = require('assert');
+var Stream = require('stream').Stream;
+var util = require('util');
+
+
+
+///--- Globals
+
+var NDEBUG = process.env.NODE_NDEBUG || false;
+
+
+
+///--- Messages
+
+var ARRAY_TYPE_REQUIRED = '%s ([%s]) required';
+var TYPE_REQUIRED = '%s (%s) is required';
+
+
+
+///--- Internal
+
+function capitalize(str) {
+        return (str.charAt(0).toUpperCase() + str.slice(1));
+}
+
+function uncapitalize(str) {
+        return (str.charAt(0).toLowerCase() + str.slice(1));
+}
+
+function _() {
+        return (util.format.apply(util, arguments));
+}
+
+
+function _assert(arg, type, name, stackFunc) {
+        if (!NDEBUG) {
+                name = name || type;
+                stackFunc = stackFunc || _assert.caller;
+                var t = typeof (arg);
+
+                if (t !== type) {
+                        throw new assert.AssertionError({
+                                message: _(TYPE_REQUIRED, name, type),
+                                actual: t,
+                                expected: type,
+                                operator: '===',
+                                stackStartFunction: stackFunc
+                        });
+                }
+        }
+}
+
+
+
+///--- API
+
+function array(arr, type, name) {
+        if (!NDEBUG) {
+                name = name || type;
+
+                if (!Array.isArray(arr)) {
+                        throw new assert.AssertionError({
+                                message: _(ARRAY_TYPE_REQUIRED, name, type),
+                                actual: typeof (arr),
+                                expected: 'array',
+                                operator: 'Array.isArray',
+                                stackStartFunction: array.caller
+                        });
+                }
+
+                for (var i = 0; i < arr.length; i++) {
+                        _assert(arr[i], type, name, array);
+                }
+        }
+}
+
+
+function bool(arg, name) {
+        _assert(arg, 'boolean', name, bool);
+}
+
+
+function buffer(arg, name) {
+        if (!Buffer.isBuffer(arg)) {
+                throw new assert.AssertionError({
+                        message: _(TYPE_REQUIRED, name, type),
+                        actual: typeof (arg),
+                        expected: 'buffer',
+                        operator: 'Buffer.isBuffer',
+                        stackStartFunction: buffer
+                });
+        }
+}
+
+
+function func(arg, name) {
+        _assert(arg, 'function', name);
+}
+
+
+function number(arg, name) {
+        _assert(arg, 'number', name);
+}
+
+
+function object(arg, name) {
+        _assert(arg, 'object', name);
+}
+
+
+function stream(arg, name) {
+        if (!(arg instanceof Stream)) {
+                throw new assert.AssertionError({
+                        message: _(TYPE_REQUIRED, name, type),
+                        actual: typeof (arg),
+                        expected: 'Stream',
+                        operator: 'instanceof',
+                        stackStartFunction: buffer
+                });
+        }
+}
+
+
+function string(arg, name) {
+        _assert(arg, 'string', name);
+}
+
+
+
+///--- Exports
+
+module.exports = {
+        bool: bool,
+        buffer: buffer,
+        func: func,
+        number: number,
+        object: object,
+        stream: stream,
+        string: string
+};
+
+
+Object.keys(module.exports).forEach(function (k) {
+        if (k === 'buffer')
+                return;
+
+        var name = 'arrayOf' + capitalize(k);
+
+        if (k === 'bool')
+                k = 'boolean';
+        if (k === 'func')
+                k = 'function';
+        module.exports[name] = function (arg, name) {
+                array(arg, k, name);
+        };
+});
+
+Object.keys(module.exports).forEach(function (k) {
+        var _name = 'optional' + capitalize(k);
+        var s = uncapitalize(k.replace('arrayOf', ''));
+        if (s === 'bool')
+                s = 'boolean';
+        if (s === 'func')
+                s = 'function';
+
+        if (k.indexOf('arrayOf') !== -1) {
+          module.exports[_name] = function (arg, name) {
+                  if (!NDEBUG && arg !== undefined) {
+                          array(arg, s, name);
+                  }
+          };
+        } else {
+          module.exports[_name] = function (arg, name) {
+                  if (!NDEBUG && arg !== undefined) {
+                          _assert(arg, s, name);
+                  }
+          };
+        }
+});
+
+
+// Reexport built-in assertions
+Object.keys(assert).forEach(function (k) {
+        if (k === 'AssertionError') {
+                module.exports[k] = assert[k];
+                return;
+        }
+
+        module.exports[k] = function () {
+                if (!NDEBUG) {
+                        assert[k].apply(assert[k], arguments);
+                }
+        };
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json	(revision 487)
@@ -0,0 +1,24 @@
+{
+  "author": {
+    "name": "Mark Cavage",
+    "email": "mcavage@gmail.com"
+  },
+  "name": "assert-plus",
+  "description": "Extra assertions on top of node's assert module",
+  "version": "0.1.2",
+  "main": "./assert.js",
+  "dependencies": {},
+  "devDependencies": {},
+  "optionalDependencies": {},
+  "engines": {
+    "node": ">=0.6"
+  },
+  "readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing.  Like\n`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks\nlike this:\n\n    var assert = require('assert-plus');\n\n    function fooAccount(options, callback) {\n\t    assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n        // Do stuff\n\t\tcallback(null, {});\n    }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n    AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n    function test(foo) {\n\t    assert.string(foo, 'foo');\n    }\n\nThere you go.  You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n    function test(foo) {\n\t    assert.arrayOfString(foo, 'foo');\n    }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n    assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n    npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
+  "readmeFilename": "README.md",
+  "_id": "assert-plus@0.1.2",
+  "dist": {
+    "shasum": "45a89f54ea7c2d3462aba816e3387f5723659c1e"
+  },
+  "_from": "assert-plus@0.1.2",
+  "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.2.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/CHANGELOG	(revision 487)
@@ -0,0 +1,71 @@
+This contains tickets fixed in each version release in reverse chronological
+order. There is one ticket per line. Each commits message has the tickets fixed
+in it. The commit message also has the corresponding github issue. i.e. CTYPE-42
+would be issue 42. Each issue can be found at:
+https://github.com/rmustacc/node-ctype/issues/%d.
+
+CTYPE v0.5.2
+CTYPE-46 Release 0.5.2
+CTYPE-45 error in setEndian logic
+
+v0.5.1
+CTYPE-44 Release 0.5.1
+Contributed by Terin Stock:
+CTYPE-41 CTypeParser.writeStruct should return its offset
+Contributed by Terin Stock:
+CTYPE-42 int64_t returns wrong size
+
+v0.5.0
+CTYPE-40 Release 0.5.0
+CTYPE-39 want > 0.6 engine support
+
+v0.4.0
+CTYPE-37 Release v0.4.0
+CTYPE-6 want additional entry point for write
+CTYPE-20 Add 64-bit int support into core parser
+CTYPE-31 Fix bounds errors node/2129
+CTYPE-33 Update copyright holders
+CTYPE-34 ctf.js confuses sign bit.
+CTYPE-35 Make the README more useful for getting started
+CTYPE-36 want manual page on ctio functions
+
+v0.3.1
+CTYPE-29 Release 0.3.1
+CTYPE-28 Want v0.6 npm support
+
+v0.3.0
+CTYPE-27 Release v0.3.0
+CTYPE-26 Want alternate default char behavior
+
+v0.2.1
+CTYPE-25 Release v0.2.1
+CTYPE-24 Writing structs is busted
+
+v0.2.0:
+CTYPE-23 Release v0.2.0
+CTYPE-21 Add support for CTF JSON data
+CTYPE-22 Add Javascriptlint profile
+CTYPE-15 Pull in ctio updates from node/master
+
+v0.1.0:
+CTYPE-18 Bump version to v0.1.0
+CTYPE-17 Fix nested structures
+CTYPE-16 Remove extraneous logging
+CTYPE-14 toAbs64 and toApprox64 are not exported
+
+v0.0.3:
+CTYPE-12 Bump version to v0.0.3
+CTYPE-11 fix typo in wuint64
+CTYPE-10 Integrate jsstyle
+
+v0.0.2:
+CTYPE-8 dump npm version to v0.0.2
+CTYPE-9 want changelog
+CTYPE-7 fix typo in detypes.
+
+v0.0.1:
+CTYPE-5 Missing from NPM registry
+CTYPE-4 int16_t calls wrong read function
+CTYPE-3 API example types are missing quotes as strings
+CTYPE-2 doc missing 64-bit functions
+CTYPE-1 Need license
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/LICENSE	(revision 487)
@@ -0,0 +1,24 @@
+The following license applies to all files unless the file is specified below.
+Each file specified below has its license information embedded in it:
+
+tools/jsstyle
+
+Copyright 2011, Robert Mustacchi. All rights reserved.
+Copyright 2011, Joyent, Inc. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/README
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/README	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/README	(revision 487)
@@ -0,0 +1,82 @@
+Node-CType is a way to read and write binary data in structured and easy to use
+format. Its name comes from the C header file.
+
+To get started, simply clone the repository or use npm to install it. Once it is
+there, simply require it.
+
+git clone git://github.com/rmustacc/node-ctype
+npm install ctype
+var mod_ctype = require('ctype')
+
+
+There are two APIs that you can use, depending on what abstraction you'd like.
+The low level API let's you read and write individual integers and floats from
+buffers. The higher level API let's you read and write structures of these. To
+illustrate this, let's looks look at how we would read and write a binary
+encoded x,y point.
+
+In C we would define this structure as follows:
+
+typedef struct point {
+	uint16_t	p_x;
+	uint16_t	p_y;
+} point_t;
+
+To read a binary encoded point from a Buffer, we first need to create a CType
+parser (where we specify the endian and other options) and add the typedef.
+
+var parser = new mod_ctype.Parser({ endian: 'big' });
+parser.typedef('point_t', [
+	{ x: { type: 'uint16_t' } },
+	{ y: { type: 'uint16_t' } }
+]);
+
+From here, given a buffer buf and an offset into it, we can read a point.
+
+var out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);
+console.log(out);
+{ point: { x: 23, y: 42 } }
+
+Another way to get the same information would be to use the low level methods.
+Note that these require you to manually deal with the offset. Here's how we'd
+get the same values of x and y from the buffer.
+
+var x = mod_ctype.ruint16(buf, 'big', 0);
+var y = mod_ctype.ruint16(buf, 'big', 2);
+console.log(x + ', ' + y);
+23, 42
+
+The true power of this API comes from the ability to define and nest typedefs,
+just as you would in C. By default, the following types are defined by default.
+Note that they return a Number, unless indicated otherwise.
+
+    * int8_t
+    * int16_t
+    * int32_t
+    * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
+    * uint8_t
+    * uint16_t
+    * uint32_t
+    * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
+    * float
+    * double
+    * char (either returns a buffer with that character or a uint8_t)
+    * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
+
+
+ctf2json integration:
+
+Node-CType supports consuming the output of ctf2json. Once you read in a JSON file,
+all you have to do to add all the definitions it contains is:
+
+var data, parser;
+data = JSON.parse(parsedJSONData);
+parser = mod_ctype.parseCTF(data, { endian: 'big' });
+
+For more documentation, see the file README.old. Full documentation is in the
+process of being rewritten as a series of manual pages which will be available
+in the repository and online for viewing.
+
+To read the ctio manual page simple run, from the root of the workspace:
+
+man -Mman -s 3ctype ctio
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/README.old	(revision 487)
@@ -0,0 +1,298 @@
+This library provides a way to read and write binary data.
+
+Node CType is a way to read and write binary data in structured and easy to use
+formats. It's name comes from the header file, though it does not share as much
+with it as it perhaps should.
+
+There are two levels of the API. One is the raw API which everything is built on
+top of, while the other provides a much nicer abstraction and is built entirely
+by using the lower level API. The hope is that the low level API is both clear
+and useful. The low level API gets it's names from stdint.h (a rather
+appropriate source). The lower level API is presented at the end of this
+document.
+
+Standard CType API
+
+The CType interface is presented as a parser object that controls the
+endianness combined with a series of methods to change that value, parse and
+write out buffers, and a way to provide typedefs.  Standard Types
+
+The CType parser supports the following basic types which return Numbers except
+as indicated:
+
+    * int8_t
+    * int16_t
+    * int32_t
+    * int64_t (returns an array where val[0] << 32 + val[1] would be the value)
+    * uint8_t
+    * uint16_t
+    * uint32_t
+    * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)
+    * float
+    * double
+    * char (returns a buffer with just that single character)
+    * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)
+
+Specifying Structs
+
+The CType parser also supports the notion of structs. A struct is an array of
+JSON objects that defines an order of keys which have types and values. One
+would build a struct to represent a point (x,y) as follows:
+
+[
+    { x: { type: 'int16_t' }},
+    { y: { type: 'int16_t' }}
+]
+
+When this is passed into the read routine, it would read the first two bytes
+(as defined by int16_t) to determine the Number to use for X, and then it would
+read the next two bytes to determine the value of Y. When read this could
+return something like:
+
+{
+    x: 42,
+    y: -23
+}
+
+When someone wants to write values, we use the same format as above, but with
+additional value field:
+
+[
+    { x: { type: 'int16_t', value: 42 }},
+    { y: { type: 'int16_t', value: -23 }}
+]
+
+Now, the structure above may be optionally annotated with offsets. This tells
+us to rather than read continuously we should read the given value at the
+specified offset. If an offset is provided, it is is effectively the equivalent
+of lseek(offset, SEEK_SET). Thus, subsequent values will be read from that
+offset and incremented by the appropriate value. As an example:
+
+[
+    { x: { type: 'int16_t' }},
+    { y: { type: 'int16_t', offset: 20 }},
+    { z: { type: 'int16_t' }}
+]
+
+We would read x from the first starting offset given to us, for the sake of
+example, let's assume that's 0. After reading x, the next offset to read from
+would be 2; however, y specifies an offset, thus we jump directly to that
+offset and read y from byte 20. We would then read z from byte 22.
+
+The same offsets may be used when writing values.
+
+Typedef
+
+The basic set of types while covers the basics, is somewhat limiting. To make
+this richer, there is functionality to typedef something like in C. One can use
+typedef to add a new name to an existing type or to define a name to refer to a
+struct. Thus the following are all examples of a typedef:
+
+typedef('size_t', 'uint32_t');
+typedef('ssize_t', 'int32_t');
+typedef('point_t', [
+    { x: { type: 'int16_t' }},
+    { y: { type: 'int16_t' }}
+]);
+
+Once something has been typedef'd it can be used in any of the definitions
+previously shown.
+
+One cannot remove a typedef once created, this is analogous to C.
+
+The set of defined types can be printed with lstypes. The format of this output
+is subject to change, but likely will look something like:
+
+> lstypes();
+{
+    size_t: 'uint32_t',
+    ssize_t: 'int32_t',
+    point_t: [
+        { x: { type: 'int16_t' }},
+        { y: { type: 'int16_t' }}
+    ]
+}
+
+Specifying arrays
+
+Arrays can be specified by appending []s to a type. Arrays must have the size
+specified. The size must be specified and it can be done in one of two ways:
+
+    * An explicit non-zero integer size
+    * A name of a previously declared variable in the struct whose value is a
+      number.
+
+Note, that when using the name of a variable, it should be the string name for
+the key. This is only valid inside structs and the value must be declared
+before the value with the array. The following are examples:
+
+[
+    { ip_addr4: { type: 'uint8_t[4]' }},
+    { len: { type: 'uint32_t' }},
+    { data: { type: 'uint8_t[len]' }}
+]
+
+Arrays are permitted in typedefs; however, they must have a declared integer
+size. The following are examples of valid and invalid arrays:
+
+typedef('path', 'char[1024]'); /* Good */
+typedef('path', 'char[len]');  /* Bad! */
+
+64 bit values:
+
+Unfortunately Javascript represents values with a double, so you lose precision
+and the ability to represent Integers roughly beyond 2^53. To alleviate this, I
+propose the following for returning 64 bit integers when read:
+
+value[2]: Each entry is a 32 bit number which can be reconstructed to the
+original by the following formula:
+
+value[0] << 32 + value[1] (Note this will not work in Javascript)
+
+CTF JSON data:
+
+node-ctype can also handle JSON data that mathces the format described in the
+documentation of the tool ctf2json. Given the JSON data which specifies type
+information, it will transform that into a parser that understands all of the
+types defined inside of it. This is useful for more complicated structures that
+have a lot of typedefs.
+
+Interface overview
+
+The following is the header-file like interface to the parser object:
+
+/*
+ * Create a new instance of the parser. Each parser has its own store of
+ * typedefs and endianness. Conf is an object with the following values:
+ *
+ *      endian          Either 'big' or 'little' do determine the endianness we
+ *                      want to read from or write to.
+ *
+ */
+function CTypeParser(conf);
+
+/*
+ * Parses the CTF JSON data and creates a parser that understands all of those
+ * types.
+ *
+ *	data		Parsed JSON data that maches that CTF JSON
+ *			specification.
+ *
+ *	conf		The configuration object to create a new CTypeParser
+ *			from.
+ */
+CTypeParser parseCTF(data, conf);
+
+/*
+ * This is what we were born to do. We read the data from a buffer and return it
+ * in an object whose keys match the values from the object.
+ *
+ *      def             The array definition of the data to read in
+ *
+ *      buffer          The buffer to read data from
+ *
+ *      offset          The offset to start writing to
+ *
+ * Returns an object where each key corresponds to an entry in def and the value
+ * is the read value.
+ */
+Object CTypeParser.readData(<Type Definition>, buffer, offset);
+
+/*
+ * This is the second half of what we were born to do, write out the data
+ * itself.
+ *
+ *      def             The array definition of the data to write out with
+ *                      values
+ *
+ *      buffer          The buffer to write to
+ *
+ *      offset          The offset in the buffer to write to
+ */
+void CTypeParser.writeData(<Type Definition>, buffer, offset);
+
+/*
+ * A user has requested to add a type, let us honor their request. Yet, if their
+ * request doth spurn us, send them unto the Hells which Dante describes.
+ *
+ *      name            The string for the type definition we're adding
+ *
+ *      value           Either a string that is a type/array name or an object
+ *                      that describes a struct.
+ */
+void CTypeParser.prototype.typedef(name, value);
+
+Object CTypeParser.prototype.lstypes();
+
+/*
+ * Get the endian value for the current parser
+ */
+String CTypeParser.prototype.getEndian();
+
+/*
+ * Sets the current endian value for the Parser. If the value is not valid,
+ * throws an Error.
+ *
+ *      endian          Either 'big' or 'little' do determine the endianness we
+ *                      want to read from or write to.
+ *
+ */
+void CTypeParser.protoype.setEndian(String);
+
+/*
+ * Attempts to convert an array of two integers returned from rsint64 / ruint64
+ * into an absolute 64 bit number. If however the value would exceed 2^52 this
+ * will instead throw an error. The mantissa in a double is a 52 bit number and
+ * rather than potentially give you a value that is an approximation this will
+ * error. If you would rather an approximation, please see toApprox64.
+ *
+ *	val		An array of two 32-bit integers
+ */
+Number function toAbs64(val)
+
+/*
+ * Will return the 64 bit value as returned in an array from rsint64 / ruint64
+ * to a value as close as it can. Note that Javascript stores all numbers as a
+ * double and the mantissa only has 52 bits. Thus this version may approximate
+ * the value.
+ *
+ *	val		An array of two 32-bit integers
+ */
+Number function toApprox64(val)
+
+Low Level API
+
+The following function are provided at the low level:
+
+Read unsigned integers from a buffer:
+Number ruint8(buffer, endian, offset);
+Number ruint16(buffer, endian, offset);
+Number ruint32(buffer, endian, offset);
+Number[] ruint64(buffer, endian, offset);
+
+Read signed integers from a buffer:
+Number rsint8(buffer, endian, offset);
+Number rsint16(buffer, endian, offset);
+Number rsint32(buffer, endian, offset);
+Number[] rsint64(buffer, endian, offset);
+
+Read floating point numbers from a buffer:
+Number rfloat(buffer, endian, offset);   /* IEEE-754 Single precision */
+Number rdouble(buffer, endian, offset);  /* IEEE-754 Double precision */
+
+Write unsigned integers to a buffer:
+void wuint8(Number, endian, buffer, offset);
+void wuint16(Number, endian, buffer, offset);
+void wuint32(Number, endian, buffer, offset);
+void wuint64(Number[], endian, buffer, offset);
+
+Write signed integers from a buffer:
+void wsint8(Number, endian, buffer, offset);
+void wsint16(Number, endian, buffer, offset);
+void wsint32(Number, endian, buffer, offset);
+void wsint64(Number[], endian, buffer offset);
+
+Write floating point numbers from a buffer:
+void wfloat(Number, buffer, endian, offset);   /* IEEE-754 Single precision */
+void wdouble(Number, buffer, endian, offset);  /* IEEE-754 Double precision */
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctf.js	(revision 487)
@@ -0,0 +1,245 @@
+/*
+ * ctf.js
+ *
+ * Understand and parse all of the different JSON formats of CTF data and
+ * translate that into a series of node-ctype friendly pieces. The reason for
+ * the abstraction is to handle different changes in the file format.
+ *
+ * We have to be careful here that we don't end up using a name that is already
+ * a built in type.
+ */
+var mod_assert = require('assert');
+var ASSERT = mod_assert.ok;
+
+var ctf_versions = [ '1.0' ];
+var ctf_entries = [ 'integer', 'float', 'typedef', 'struct' ];
+var ctf_deftypes = [ 'int8_t', 'uint8_t', 'int16_t', 'uint16_t', 'int32_t',
+    'uint32_t', 'float', 'double' ];
+
+function ctfParseInteger(entry, ctype)
+{
+	var name, sign, len, type;
+
+	name = entry['name'];
+	if (!('signed' in entry['integer']))
+		throw (new Error('Malformed CTF JSON: integer missing ' +
+		    'signed value'));
+
+
+	if (!('length' in entry['integer']))
+		throw (new Error('Malformed CTF JSON: integer missing ' +
+		    'length value'));
+
+	sign = entry['integer']['signed'];
+	len = entry['integer']['length'];
+	type = null;
+
+	if (sign && len == 1)
+		type = 'int8_t';
+	else if (len == 1)
+		type = 'uint8_t';
+	else if (sign && len == 2)
+		type = 'int16_t';
+	else if (len == 2)
+		type = 'uint16_t';
+	else if (sign && len == 4)
+		type = 'int32_t';
+	else if (len == 4)
+		type = 'uint32_t';
+	else if (sign && len == 8)
+		type = 'int64_t';
+	else if (len == 8)
+		type = 'uint64_t';
+
+	if (type === null)
+		throw (new Error('Malformed CTF JSON: integer has ' +
+		    'unsupported length and sign - ' + len + '/' + sign));
+
+	/*
+	 * This means that this is the same as one of our built in types. If
+	 * that's the case defining it would be an error. So instead of trying
+	 * to typedef it, we'll return here.
+	 */
+	if (name == type)
+		return;
+
+	if (name == 'char') {
+		ASSERT(type == 'int8_t');
+		return;
+	}
+
+	ctype.typedef(name, type);
+}
+
+function ctfParseFloat(entry, ctype)
+{
+	var name, len;
+
+	name = entry['name'];
+	if (!('length' in entry['float']))
+		throw (new Error('Malformed CTF JSON: float missing ' +
+		    'length value'));
+
+	len = entry['float']['length'];
+	if (len != 4 && len != 8)
+		throw (new Error('Malformed CTF JSON: float has invalid ' +
+		    'length value'));
+
+	if (len == 4) {
+		if (name == 'float')
+			return;
+		ctype.typedef(name, 'float');
+	} else if (len == 8) {
+		if (name == 'double')
+			return;
+		ctype.typedef(name, 'double');
+	}
+}
+
+function ctfParseTypedef(entry, ctype)
+{
+	var name, type, ii;
+
+	name = entry['name'];
+	if (typeof (entry['typedef']) != 'string')
+		throw (new Error('Malformed CTF JSON: typedef value in not ' +
+		    'a string'));
+
+	type = entry['typedef'];
+
+	/*
+	 * We need to ensure that we're not looking at type that's one of our
+	 * built in types. Traditionally in C a uint32_t would be a typedef to
+	 * some kind of integer. However, those size types are built ins.
+	 */
+	for (ii = 0; ii < ctf_deftypes.length; ii++) {
+		if (name == ctf_deftypes[ii])
+			return;
+	}
+
+	ctype.typedef(name, type);
+}
+
+function ctfParseStruct(entry, ctype)
+{
+	var name, type, ii, val, index, member, push;
+
+	member = [];
+	if (!Array.isArray(entry['struct']))
+		throw (new Error('Malformed CTF JSON: struct value is not ' +
+		    'an array'));
+
+	for (ii = 0; ii < entry['struct'].length; ii++) {
+		val = entry['struct'][ii];
+		if (!('name' in val))
+			throw (new Error('Malformed CTF JSON: struct member ' +
+			    'missing name'));
+
+		if (!('type' in val))
+			throw (new Error('Malformed CTF JSON: struct member ' +
+			    'missing type'));
+
+		if (typeof (val['name']) != 'string')
+			throw (new Error('Malformed CTF JSON: struct member ' +
+			    'name isn\'t a string'));
+
+		if (typeof (val['type']) != 'string')
+			throw (new Error('Malformed CTF JSON: struct member ' +
+			    'type isn\'t a string'));
+
+		/*
+		 * CTF version 2 specifies array names as <type> [<num>] where
+		 * as node-ctype does this as <type>[<num>].
+		 */
+		name = val['name'];
+		type = val['type'];
+		index = type.indexOf(' [');
+		if (index != -1) {
+			type = type.substring(0, index) +
+			    type.substring(index + 1, type.length);
+		}
+		push = {};
+		push[name] = { 'type': type };
+		member.push(push);
+	}
+
+	name = entry['name'];
+	ctype.typedef(name, member);
+}
+
+function ctfParseEntry(entry, ctype)
+{
+	var ii, found;
+
+	if (!('name' in entry))
+		throw (new Error('Malformed CTF JSON: entry missing "name" ' +
+		    'section'));
+
+	for (ii = 0; ii < ctf_entries.length; ii++) {
+		if (ctf_entries[ii] in entry)
+			found++;
+	}
+
+	if (found === 0)
+		throw (new Error('Malformed CTF JSON: found no entries'));
+
+	if (found >= 2)
+		throw (new Error('Malformed CTF JSON: found more than one ' +
+		    'entry'));
+
+	if ('integer' in entry) {
+		ctfParseInteger(entry, ctype);
+		return;
+	}
+
+	if ('float' in entry) {
+		ctfParseFloat(entry, ctype);
+		return;
+	}
+
+	if ('typedef' in entry) {
+		ctfParseTypedef(entry, ctype);
+		return;
+	}
+
+	if ('struct' in entry) {
+		ctfParseStruct(entry, ctype);
+		return;
+	}
+
+	ASSERT(false, 'shouldn\'t reach here');
+}
+
+function ctfParseJson(json, ctype)
+{
+	var version, ii;
+
+	ASSERT(json);
+	ASSERT(ctype);
+	if (!('metadata' in json))
+		throw (new Error('Invalid CTF JSON: missing metadata section'));
+
+	if (!('ctf2json_version' in json['metadata']))
+		throw (new Error('Invalid CTF JSON: missing ctf2json_version'));
+
+	version = json['metadata']['ctf2json_version'];
+	for (ii = 0; ii < ctf_versions.length; ii++) {
+		if (ctf_versions[ii] == version)
+			break;
+	}
+
+	if (ii == ctf_versions.length)
+		throw (new Error('Unsuported ctf2json_version: ' + version));
+
+	if (!('data' in json))
+		throw (new Error('Invalid CTF JSON: missing data section'));
+
+	if (!Array.isArray(json['data']))
+		throw (new Error('Malformed CTF JSON: data section is not ' +
+		    'an array'));
+
+	for (ii = 0; ii < json['data'].length; ii++)
+		ctfParseEntry(json['data'][ii], ctype);
+}
+
+exports.ctfParseJson = ctfParseJson;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctio.js	(revision 487)
@@ -0,0 +1,1485 @@
+/*
+ * rm - Feb 2011
+ * ctio.js:
+ *
+ * A simple way to read and write simple ctypes. Of course, as you'll find the
+ * code isn't as simple as it might appear. The following types are currently
+ * supported in big and little endian formats:
+ *
+ * 	uint8_t			int8_t
+ * 	uint16_t		int16_t
+ * 	uint32_t		int32_t
+ *	float (single precision IEEE 754)
+ *	double (double precision IEEE 754)
+ *
+ * This is designed to work in Node and v8. It may in fact work in other
+ * Javascript interpreters (that'd be pretty neat), but it hasn't been tested.
+ * If you find that it does in fact work, that's pretty cool. Try and pass word
+ * back to the original author.
+ *
+ * Note to the reader: If you're tabstop isn't set to 8, parts of this may look
+ * weird.
+ */
+
+/*
+ * Numbers in Javascript have a secret: all numbers must be represented with an
+ * IEEE-754 double. The double has a mantissa with a length of 52 bits with an
+ * implicit one. Thus the range of integers that can be represented is limited
+ * to the size of the mantissa, this makes reading and writing 64-bit integers
+ * difficult, but far from impossible.
+ *
+ * Another side effect of this representation is what happens when you use the
+ * bitwise operators, i.e. shift left, shift right, and, or, etc. In Javascript,
+ * each operand and the result is cast to a signed 32-bit number. However, in
+ * the case of >>> the values are cast to an unsigned number.
+ */
+
+/*
+ * A reminder on endian related issues:
+ *
+ * Big Endian: MSB -> First byte
+ * Little Endian: MSB->Last byte
+ */
+var mod_assert = require('assert');
+
+/*
+ * An 8 bit unsigned integer involves doing no significant work.
+ */
+function ruint8(buffer, endian, offset)
+{
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	return (buffer[offset]);
+}
+
+/*
+ * For 16 bit unsigned numbers we can do all the casting that we want to do.
+ */
+function rgint16(buffer, endian, offset)
+{
+	var val = 0;
+
+	if (endian == 'big') {
+		val = buffer[offset] << 8;
+		val |=  buffer[offset+1];
+	} else {
+		val = buffer[offset];
+		val |= buffer[offset+1] << 8;
+	}
+
+	return (val);
+
+}
+
+function ruint16(buffer, endian, offset)
+{
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 1 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	return (rgint16(buffer, endian, offset));
+}
+
+/*
+ * Because most bitshifting is done using signed numbers, if we would go into
+ * the realm where we use that 32nd bit, we'll end up going into the negative
+ * range. i.e.:
+ * > 200 << 24
+ * -939524096
+ *
+ * Not the value you'd expect. To work around this, we end up having to do some
+ * abuse of the JavaScript standard. in this case, we know that a >>> shift is
+ * defined to cast our value to an *unsigned* 32-bit number. Because of that, we
+ * use that instead to save us some additional math, though it does feel a
+ * little weird and it isn't obvious as to why you woul dwant to do this at
+ * first.
+ */
+function rgint32(buffer, endian, offset)
+{
+	var val = 0;
+
+	if (endian == 'big') {
+		val = buffer[offset+1] << 16;
+		val |= buffer[offset+2] << 8;
+		val |= buffer[offset+3];
+		val = val + (buffer[offset] << 24 >>> 0);
+	} else {
+		val = buffer[offset+2] << 16;
+		val |= buffer[offset+1] << 8;
+		val |= buffer[offset];
+		val = val + (buffer[offset + 3] << 24 >>> 0);
+	}
+
+	return (val);
+}
+
+function ruint32(buffer, endian, offset)
+{
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	return (rgint32(buffer, endian, offset));
+}
+
+/*
+ * Reads a 64-bit unsigned number. The astue observer will note that this
+ * doesn't quite work. Javascript has chosen to only have numbers that can be
+ * represented by a double. A double only has 52 bits of mantissa with an
+ * implicit 1, thus we have up to 53 bits to represent an integer. However, 2^53
+ * doesn't quite give us what we want. Isn't 53 bits enough for anyone? What
+ * could you have possibly wanted to represent that was larger than that? Oh,
+ * maybe a size? You mean we bypassed the 4 GB limit on file sizes, when did
+ * that happen?
+ *
+ * To get around this egregious language issue, we're going to instead construct
+ * an array of two 32 bit unsigned integers. Where arr[0] << 32 + arr[1] would
+ * give the actual number. However, note that the above code probably won't
+ * produce the desired results because of the way Javascript numbers are
+ * doubles.
+ */
+function rgint64(buffer, endian, offset)
+{
+	var val = new Array(2);
+
+	if (endian == 'big') {
+		val[0] = ruint32(buffer, endian, offset);
+		val[1] = ruint32(buffer, endian, offset+4);
+	} else {
+		val[0] = ruint32(buffer, endian, offset+4);
+		val[1] = ruint32(buffer, endian, offset);
+	}
+
+	return (val);
+}
+
+function ruint64(buffer, endian, offset)
+{
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 7 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	return (rgint64(buffer, endian, offset));
+}
+
+
+/*
+ * Signed integer types, yay team! A reminder on how two's complement actually
+ * works. The first bit is the signed bit, i.e. tells us whether or not the
+ * number should be positive or negative. If the two's complement value is
+ * positive, then we're done, as it's equivalent to the unsigned representation.
+ *
+ * Now if the number is positive, you're pretty much done, you can just leverage
+ * the unsigned translations and return those. Unfortunately, negative numbers
+ * aren't quite that straightforward.
+ *
+ * At first glance, one might be inclined to use the traditional formula to
+ * translate binary numbers between the positive and negative values in two's
+ * complement. (Though it doesn't quite work for the most negative value)
+ * Mainly:
+ *  - invert all the bits
+ *  - add one to the result
+ *
+ * Of course, this doesn't quite work in Javascript. Take for example the value
+ * of -128. This could be represented in 16 bits (big-endian) as 0xff80. But of
+ * course, Javascript will do the following:
+ *
+ * > ~0xff80
+ * -65409
+ *
+ * Whoh there, Javascript, that's not quite right. But wait, according to
+ * Javascript that's perfectly correct. When Javascript ends up seeing the
+ * constant 0xff80, it has no notion that it is actually a signed number. It
+ * assumes that we've input the unsigned value 0xff80. Thus, when it does the
+ * binary negation, it casts it into a signed value, (positive 0xff80). Then
+ * when you perform binary negation on that, it turns it into a negative number.
+ *
+ * Instead, we're going to have to use the following general formula, that works
+ * in a rather Javascript friendly way. I'm glad we don't support this kind of
+ * weird numbering scheme in the kernel.
+ *
+ * (BIT-MAX - (unsigned)val + 1) * -1
+ *
+ * The astute observer, may think that this doesn't make sense for 8-bit numbers
+ * (really it isn't necessary for them). However, when you get 16-bit numbers,
+ * you do. Let's go back to our prior example and see how this will look:
+ *
+ * (0xffff - 0xff80 + 1) * -1
+ * (0x007f + 1) * -1
+ * (0x0080) * -1
+ *
+ * Doing it this way ends up allowing us to treat it appropriately in
+ * Javascript. Sigh, that's really quite ugly for what should just be a few bit
+ * shifts, ~ and &.
+ */
+
+/*
+ * Endianness doesn't matter for 8-bit signed values. We could in fact optimize
+ * this case because the more traditional methods work, but for consistency,
+ * we'll keep doing this the same way.
+ */
+function rsint8(buffer, endian, offset)
+{
+	var neg;
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	neg = buffer[offset] & 0x80;
+	if (!neg)
+		return (buffer[offset]);
+
+	return ((0xff - buffer[offset] + 1) * -1);
+}
+
+/*
+ * The 16-bit version requires a bit more effort. In this case, we can leverage
+ * our unsigned code to generate the value we want to return.
+ */
+function rsint16(buffer, endian, offset)
+{
+	var neg, val;
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 1 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = rgint16(buffer, endian, offset);
+	neg = val & 0x8000;
+	if (!neg)
+		return (val);
+
+	return ((0xffff - val + 1) * -1);
+}
+
+/*
+ * We really shouldn't leverage our 32-bit code here and instead utilize the
+ * fact that we know that since these are signed numbers, we can do all the
+ * shifting and binary anding to generate the 32-bit number. But, for
+ * consistency we'll do the same. If we want to do otherwise, we should instead
+ * make the 32 bit unsigned code do the optimization. But as long as there
+ * aren't floats secretly under the hood for that, we /should/ be okay.
+ */
+function rsint32(buffer, endian, offset)
+{
+	var neg, val;
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = rgint32(buffer, endian, offset);
+	neg = val & 0x80000000;
+	if (!neg)
+		return (val);
+
+	return ((0xffffffff - val + 1) * -1);
+}
+
+/*
+ * The signed version of this code suffers from all of the same problems of the
+ * other 64 bit version.
+ */
+function rsint64(buffer, endian, offset)
+{
+	var neg, val;
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = rgint64(buffer, endian, offset);
+	neg = val[0] & 0x80000000;
+
+	if (!neg)
+		return (val);
+
+	val[0] = (0xffffffff - val[0]) * -1;
+	val[1] = (0xffffffff - val[1] + 1) * -1;
+
+	/*
+	 * If we had the key 0x8000000000000000, that would leave the lower 32
+	 * bits as 0xffffffff, however, since we're goint to add one, that would
+	 * actually leave the lower 32-bits as 0x100000000, which would break
+	 * our ability to write back a value that we received. To work around
+	 * this, if we actually get that value, we're going to bump the upper
+	 * portion by 1 and set this to zero.
+	 */
+	mod_assert.ok(val[1] <= 0x100000000);
+	if (val[1] == -0x100000000) {
+		val[1] = 0;
+		val[0]--;
+	}
+
+	return (val);
+}
+
+/*
+ * We now move onto IEEE 754: The traditional form for floating point numbers
+ * and what is secretly hiding at the heart of everything in this. I really hope
+ * that someone is actually using this, as otherwise, this effort is probably
+ * going to be more wasted.
+ *
+ * One might be tempted to use parseFloat here, but that wouldn't work at all
+ * for several reasons. Mostly due to the way floats actually work, and
+ * parseFloat only actually works in base 10. I don't see base 10 anywhere near
+ * this file.
+ *
+ * In this case we'll implement the single and double precision versions. The
+ * quadruple precision, while probably useful, wouldn't really be accepted by
+ * Javascript, so let's not even waste our time.
+ *
+ * So let's review how this format looks like. A single precision value is 32
+ * bits and has three parts:
+ *   -  Sign bit
+ *   -  Exponent (Using bias notation)
+ *   -  Mantissa
+ *
+ * |s|eeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmm|
+ * 31| 30-23  |  22    	-       0       |
+ *
+ * The exponent is stored in a biased input. The bias in this case 127.
+ * Therefore, our exponent is equal to the 8-bit value - 127.
+ *
+ * By default, a number is normalized in IEEE, that means that the mantissa has
+ * an implicit one that we don't see. So really the value stored is 1.m.
+ * However, if the exponent is all zeros, then instead we have to shift
+ * everything to the right one and there is no more implicit one.
+ *
+ * Special values:
+ *  - Positive Infinity:
+ *	Sign:		0
+ *	Exponent: 	All 1s
+ *	Mantissa:	0
+ *  - Negative Infinity:
+ *	Sign:		1
+ *	Exponent: 	All 1s
+ *	Mantissa:	0
+ *  - NaN:
+ *	Sign:		*
+ *	Exponent: 	All 1s
+ *	Mantissa:	non-zero
+ *  - Zero:
+ *	Sign:		*
+ *	Exponent:	All 0s
+ *	Mantissa:	0
+ *
+ * In the case of zero, the sign bit determines whether we get a positive or
+ * negative zero. However, since Javascript cannot determine the difference
+ * between the two: i.e. -0 == 0, we just always return 0.
+ *
+ */
+function rfloat(buffer, endian, offset)
+{
+	var bytes = [];
+	var sign, exponent, mantissa, val;
+	var bias = 127;
+	var maxexp = 0xff;
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	/* Normalize the bytes to be in endian order */
+	if (endian == 'big') {
+		bytes[0] = buffer[offset];
+		bytes[1] = buffer[offset+1];
+		bytes[2] = buffer[offset+2];
+		bytes[3] = buffer[offset+3];
+	} else {
+		bytes[3] = buffer[offset];
+		bytes[2] = buffer[offset+1];
+		bytes[1] = buffer[offset+2];
+		bytes[0] = buffer[offset+3];
+	}
+
+	sign = bytes[0] & 0x80;
+	exponent = (bytes[0] & 0x7f) << 1;
+	exponent |= (bytes[1] & 0x80) >>> 7;
+	mantissa = (bytes[1] & 0x7f) << 16;
+	mantissa |= bytes[2] << 8;
+	mantissa |= bytes[3];
+
+	/* Check for special cases before we do general parsing */
+	if (!sign && exponent == maxexp && mantissa === 0)
+		return (Number.POSITIVE_INFINITY);
+
+	if (sign && exponent == maxexp && mantissa === 0)
+		return (Number.NEGATIVE_INFINITY);
+
+	if (exponent == maxexp && mantissa !== 0)
+		return (Number.NaN);
+
+	/*
+	 * Javascript really doesn't have support for positive or negative zero.
+	 * So we're not going to try and give it to you. That would be just
+	 * plain weird. Besides -0 == 0.
+	 */
+	if (exponent === 0 && mantissa === 0)
+		return (0);
+
+	/*
+	 * Now we can deal with the bias and the determine whether the mantissa
+	 * has the implicit one or not.
+	 */
+	exponent -= bias;
+	if (exponent == -bias) {
+		exponent++;
+		val = 0;
+	} else {
+		val = 1;
+	}
+
+	val = (val + mantissa * Math.pow(2, -23)) * Math.pow(2, exponent);
+
+	if (sign)
+		val *= -1;
+
+	return (val);
+}
+
+/*
+ * Doubles in IEEE 754 are like their brothers except for a few changes and
+ * increases in size:
+ *   - The exponent is now 11 bits
+ *   - The mantissa is now 52 bits
+ *   - The bias is now 1023
+ *
+ * |s|eeeeeeeeeee|mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm|
+ * 63| 62 - 52   | 	51		-			0     |
+ * 63| 62 - 52   |      51              -                       0     |
+ *
+ * While the size has increased a fair amount, we're going to end up keeping the
+ * same general formula for calculating the final value. As a reminder, this
+ * formula is:
+ *
+ * (-1)^s * (n + m) * 2^(e-b)
+ *
+ * Where:
+ *	s	is the sign bit
+ *	n	is (exponent > 0) ? 1 : 0 -- Determines whether we're normalized
+ *					     or not
+ *	m	is the mantissa
+ *	e	is the exponent specified
+ *	b	is the bias for the exponent
+ *
+ */
+function rdouble(buffer, endian, offset)
+{
+	var bytes = [];
+	var sign, exponent, mantissa, val, lowmant;
+	var bias = 1023;
+	var maxexp = 0x7ff;
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 7 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	/* Normalize the bytes to be in endian order */
+	if (endian == 'big') {
+		bytes[0] = buffer[offset];
+		bytes[1] = buffer[offset+1];
+		bytes[2] = buffer[offset+2];
+		bytes[3] = buffer[offset+3];
+		bytes[4] = buffer[offset+4];
+		bytes[5] = buffer[offset+5];
+		bytes[6] = buffer[offset+6];
+		bytes[7] = buffer[offset+7];
+	} else {
+		bytes[7] = buffer[offset];
+		bytes[6] = buffer[offset+1];
+		bytes[5] = buffer[offset+2];
+		bytes[4] = buffer[offset+3];
+		bytes[3] = buffer[offset+4];
+		bytes[2] = buffer[offset+5];
+		bytes[1] = buffer[offset+6];
+		bytes[0] = buffer[offset+7];
+	}
+
+	/*
+	 * We can construct the exponent and mantissa the same way as we did in
+	 * the case of a float, just increase the range of the exponent.
+	 */
+	sign = bytes[0] & 0x80;
+	exponent = (bytes[0] & 0x7f) << 4;
+	exponent |= (bytes[1] & 0xf0) >>> 4;
+
+	/*
+	 * This is going to be ugly but then again, we're dealing with IEEE 754.
+	 * This could probably be done as a node add on in a few lines of C++,
+	 * but oh we'll, we've made it this far so let's be native the rest of
+	 * the way...
+	 *
+	 * What we're going to do is break the mantissa into two parts, the
+	 * lower 24 bits and the upper 28 bits. We'll multiply the upper 28 bits
+	 * by the appropriate power and then add in the lower 24-bits. Not
+	 * really that great. It's pretty much a giant kludge to deal with
+	 * Javascript eccentricities around numbers.
+	 */
+	lowmant = bytes[7];
+	lowmant |= bytes[6] << 8;
+	lowmant |= bytes[5] << 16;
+	mantissa = bytes[4];
+	mantissa |= bytes[3] << 8;
+	mantissa |= bytes[2] << 16;
+	mantissa |= (bytes[1] & 0x0f) << 24;
+	mantissa *= Math.pow(2, 24); /* Equivalent to << 24, but JS compat */
+	mantissa += lowmant;
+
+	/* Check for special cases before we do general parsing */
+	if (!sign && exponent == maxexp && mantissa === 0)
+		return (Number.POSITIVE_INFINITY);
+
+	if (sign && exponent == maxexp && mantissa === 0)
+		return (Number.NEGATIVE_INFINITY);
+
+	if (exponent == maxexp && mantissa !== 0)
+		return (Number.NaN);
+
+	/*
+	 * Javascript really doesn't have support for positive or negative zero.
+	 * So we're not going to try and give it to you. That would be just
+	 * plain weird. Besides -0 == 0.
+	 */
+	if (exponent === 0 && mantissa === 0)
+		return (0);
+
+	/*
+	 * Now we can deal with the bias and the determine whether the mantissa
+	 * has the implicit one or not.
+	 */
+	exponent -= bias;
+	if (exponent == -bias) {
+		exponent++;
+		val = 0;
+	} else {
+		val = 1;
+	}
+
+	val = (val + mantissa * Math.pow(2, -52)) * Math.pow(2, exponent);
+
+	if (sign)
+		val *= -1;
+
+	return (val);
+}
+
+/*
+ * Now that we have gone through the pain of reading the individual types, we're
+ * probably going to want some way to write these back. None of this is going to
+ * be good. But since we have Javascript numbers this should certainly be more
+ * interesting. Though we can constrain this end a little bit more in what is
+ * valid. For now, let's go back to our friends the unsigned value.
+ */
+
+/*
+ * Unsigned numbers seem deceptively easy. Here are the general steps and rules
+ * that we are going to take:
+ *   -  If the number is negative, throw an Error
+ *   -  Truncate any floating point portion
+ *   -  Take the modulus of the number in our base
+ *   -  Write it out to the buffer in the endian format requested at the offset
+ */
+
+/*
+ * We have to make sure that the value is a valid integer. This means that it is
+ * non-negative. It has no fractional component and that it does not exceed the
+ * maximum allowed value.
+ *
+ *	value		The number to check for validity
+ *
+ *	max		The maximum value
+ */
+function prepuint(value, max)
+{
+	if (typeof (value) != 'number')
+		throw (new (Error('cannot write a non-number as a number')));
+
+	if (value < 0)
+		throw (new Error('specified a negative value for writing an ' +
+		    'unsigned value'));
+
+	if (value > max)
+		throw (new Error('value is larger than maximum value for ' +
+		    'type'));
+
+	if (Math.floor(value) !== value)
+		throw (new Error('value has a fractional component'));
+
+	return (value);
+}
+
+/*
+ * 8-bit version, classy. We can ignore endianness which is good.
+ */
+function wuint8(value, endian, buffer, offset)
+{
+	var val;
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = prepuint(value, 0xff);
+	buffer[offset] = val;
+}
+
+/*
+ * Pretty much the same as the 8-bit version, just this time we need to worry
+ * about endian related issues.
+ */
+function wgint16(val, endian, buffer, offset)
+{
+	if (endian == 'big') {
+		buffer[offset] = (val & 0xff00) >>> 8;
+		buffer[offset+1] = val & 0x00ff;
+	} else {
+		buffer[offset+1] = (val & 0xff00) >>> 8;
+		buffer[offset] = val & 0x00ff;
+	}
+}
+
+function wuint16(value, endian, buffer, offset)
+{
+	var val;
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 1 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = prepuint(value, 0xffff);
+	wgint16(val, endian, buffer, offset);
+}
+
+/*
+ * The 32-bit version is going to have to be a little different unfortunately.
+ * We can't quite bitshift to get the largest byte, because that would end up
+ * getting us caught by the signed values.
+ *
+ * And yes, we do want to subtract out the lower part by default. This means
+ * that when we do the division, it will be treated as a bit shift and we won't
+ * end up generating a floating point value. If we did generate a floating point
+ * value we'd have to truncate it intelligently, this saves us that problem and
+ * may even be somewhat faster under the hood.
+ */
+function wgint32(val, endian, buffer, offset)
+{
+	if (endian == 'big') {
+		buffer[offset] = (val - (val & 0x00ffffff)) / Math.pow(2, 24);
+		buffer[offset+1] = (val >>> 16) & 0xff;
+		buffer[offset+2] = (val >>> 8) & 0xff;
+		buffer[offset+3] = val & 0xff;
+	} else {
+		buffer[offset+3] = (val - (val & 0x00ffffff)) /
+		    Math.pow(2, 24);
+		buffer[offset+2] = (val >>> 16) & 0xff;
+		buffer[offset+1] = (val >>> 8) & 0xff;
+		buffer[offset] = val & 0xff;
+	}
+}
+
+function wuint32(value, endian, buffer, offset)
+{
+	var val;
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = prepuint(value, 0xffffffff);
+	wgint32(val, endian, buffer, offset);
+}
+
+/*
+ * Unlike the other versions, we expect the value to be in the form of two
+ * arrays where value[0] << 32 + value[1] would result in the value that we
+ * want.
+ */
+function wgint64(value, endian, buffer, offset)
+{
+	if (endian == 'big') {
+		wgint32(value[0], endian, buffer, offset);
+		wgint32(value[1], endian, buffer, offset+4);
+	} else {
+		wgint32(value[0], endian, buffer, offset+4);
+		wgint32(value[1], endian, buffer, offset);
+	}
+}
+
+function wuint64(value, endian, buffer, offset)
+{
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (!(value instanceof Array))
+		throw (new Error('value must be an array'));
+
+	if (value.length != 2)
+		throw (new Error('value must be an array of length 2'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 7 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	prepuint(value[0], 0xffffffff);
+	prepuint(value[1], 0xffffffff);
+	wgint64(value, endian, buffer, offset);
+}
+
+/*
+ * We now move onto our friends in the signed number category. Unlike unsigned
+ * numbers, we're going to have to worry a bit more about how we put values into
+ * arrays. Since we are only worrying about signed 32-bit values, we're in
+ * slightly better shape. Unfortunately, we really can't do our favorite binary
+ * & in this system. It really seems to do the wrong thing. For example:
+ *
+ * > -32 & 0xff
+ * 224
+ *
+ * What's happening above is really: 0xe0 & 0xff = 0xe0. However, the results of
+ * this aren't treated as a signed number. Ultimately a bad thing.
+ *
+ * What we're going to want to do is basically create the unsigned equivalent of
+ * our representation and pass that off to the wuint* functions. To do that
+ * we're going to do the following:
+ *
+ *  - if the value is positive
+ *	we can pass it directly off to the equivalent wuint
+ *  - if the value is negative
+ *	we do the following computation:
+ *	mb + val + 1, where
+ *	mb	is the maximum unsigned value in that byte size
+ *	val	is the Javascript negative integer
+ *
+ *
+ * As a concrete value, take -128. In signed 16 bits this would be 0xff80. If
+ * you do out the computations:
+ *
+ * 0xffff - 128 + 1
+ * 0xffff - 127
+ * 0xff80
+ *
+ * You can then encode this value as the signed version. This is really rather
+ * hacky, but it should work and get the job done which is our goal here.
+ *
+ * Thus the overall flow is:
+ *   -  Truncate the floating point part of the number
+ *   -  We don't have to take the modulus, because the unsigned versions will
+ *   	take care of that for us. And we don't have to worry about that
+ *   	potentially causing bad things to happen because of sign extension
+ *   -  Pass it off to the appropriate unsigned version, potentially modifying
+ *	the negative portions as necessary.
+ */
+
+/*
+ * A series of checks to make sure we actually have a signed 32-bit number
+ */
+function prepsint(value, max, min)
+{
+	if (typeof (value) != 'number')
+		throw (new (Error('cannot write a non-number as a number')));
+
+	if (value > max)
+		throw (new Error('value larger than maximum allowed value'));
+
+	if (value < min)
+		throw (new Error('value smaller than minimum allowed value'));
+
+	if (Math.floor(value) !== value)
+		throw (new Error('value has a fractional component'));
+
+	return (value);
+}
+
+/*
+ * The 8-bit version of the signed value. Overall, fairly straightforward.
+ */
+function wsint8(value, endian, buffer, offset)
+{
+	var val;
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = prepsint(value, 0x7f, -0x80);
+	if (val >= 0)
+		wuint8(val, endian, buffer, offset);
+	else
+		wuint8(0xff + val + 1, endian, buffer, offset);
+}
+
+/*
+ * The 16-bit version of the signed value. Also, fairly straightforward.
+ */
+function wsint16(value, endian, buffer, offset)
+{
+	var val;
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 1 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = prepsint(value, 0x7fff, -0x8000);
+	if (val >= 0)
+		wgint16(val, endian, buffer, offset);
+	else
+		wgint16(0xffff + val + 1, endian, buffer, offset);
+
+}
+
+/*
+ * We can do this relatively easily by leveraging the code used for 32-bit
+ * unsigned code.
+ */
+function wsint32(value, endian, buffer, offset)
+{
+	var val;
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	val = prepsint(value, 0x7fffffff, -0x80000000);
+	if (val >= 0)
+		wgint32(val, endian, buffer, offset);
+	else
+		wgint32(0xffffffff + val + 1, endian, buffer, offset);
+}
+
+/*
+ * The signed 64 bit integer should by in the same format as when received.
+ * Mainly it should ensure that the value is an array of two integers where
+ * value[0] << 32 + value[1] is the desired number. Furthermore, the two values
+ * need to be equal.
+ */
+function wsint64(value, endian, buffer, offset)
+{
+	var vzpos, vopos;
+	var vals = new Array(2);
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (!(value instanceof Array))
+		throw (new Error('value must be an array'));
+
+	if (value.length != 2)
+		throw (new Error('value must be an array of length 2'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+	if (offset + 7 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	/*
+	 * We need to make sure that we have the same sign on both values. The
+	 * hokiest way to to do this is to multiply the number by +inf. If we do
+	 * this, we'll get either +/-inf depending on the sign of the value.
+	 * Once we have this, we can compare it to +inf to see if the number is
+	 * positive or not.
+	 */
+	vzpos = (value[0] * Number.POSITIVE_INFINITY) ==
+	    Number.POSITIVE_INFINITY;
+	vopos = (value[1] * Number.POSITIVE_INFINITY) ==
+	    Number.POSITIVE_INFINITY;
+
+	/*
+	 * If either of these is zero, then we don't actually need this check.
+	 */
+	if (value[0] != 0 && value[1] != 0 && vzpos != vopos)
+		throw (new Error('Both entries in the array must have ' +
+		    'the same sign'));
+
+	/*
+	 * Doing verification for a signed 64-bit integer is actually a big
+	 * trickier than it appears. We can't quite use our standard techniques
+	 * because we need to compare both sets of values. The first value is
+	 * pretty straightforward. If the first value is beond the extremes than
+	 * we error out. However, the valid range of the second value varies
+	 * based on the first one. If the first value is negative, and *not* the
+	 * largest negative value, than it can be any integer within the range [
+	 * 0, 0xffffffff ]. If it is the largest negative number, it must be
+	 * zero.
+	 *
+	 * If the first number is positive, than it doesn't matter what the
+	 * value is. We just simply have to make sure we have a valid positive
+	 * integer.
+	 */
+	if (vzpos) {
+		prepuint(value[0], 0x7fffffff);
+		prepuint(value[1], 0xffffffff);
+	} else {
+		prepsint(value[0], 0, -0x80000000);
+		prepsint(value[1], 0, -0xffffffff);
+		if (value[0] == -0x80000000 && value[1] != 0)
+			throw (new Error('value smaller than minimum ' +
+			    'allowed value'));
+	}
+
+	/* Fix negative numbers */
+	if (value[0] < 0 || value[1] < 0) {
+		vals[0] = 0xffffffff - Math.abs(value[0]);
+		vals[1] = 0x100000000 - Math.abs(value[1]);
+		if (vals[1] == 0x100000000) {
+			vals[1] = 0;
+			vals[0]++;
+		}
+	} else {
+		vals[0] = value[0];
+		vals[1] = value[1];
+	}
+	wgint64(vals, endian, buffer, offset);
+}
+
+/*
+ * Now we are moving onto the weirder of these, the float and double. For this
+ * we're going to just have to do something that's pretty weird. First off, we
+ * have no way to get at the underlying float representation, at least not
+ * easily. But that doesn't mean we can't figure it out, we just have to use our
+ * heads.
+ *
+ * One might propose to use Number.toString(2). Of course, this is not really
+ * that good, because the ECMAScript 262 v3 Standard says the following Section
+ * 15.7.4.2-Number.prototype.toString (radix):
+ *
+ * If radix is an integer from 2 to 36, but not 10, the result is a string, the
+ * choice of which is implementation-dependent.
+ *
+ * Well that doesn't really help us one bit now does it? We could use the
+ * standard base 10 version of the string, but that's just going to create more
+ * errors as we end up trying to convert it back to a binary value. So, really
+ * this just means we have to be non-lazy and parse the structure intelligently.
+ *
+ * First off, we can do the basic checks: NaN, positive and negative infinity.
+ *
+ * Now that those are done we can work backwards to generate the mantissa and
+ * exponent.
+ *
+ * The first thing we need to do is determine the sign bit, easy to do, check
+ * whether the value is less than 0. And convert the number to its absolute
+ * value representation. Next, we need to determine if the value is less than
+ * one or greater than or equal to one and from there determine what power was
+ * used to get there. What follows is now specific to floats, though the general
+ * ideas behind this will hold for doubles as well, but the exact numbers
+ * involved will change.
+ *
+ * Once we have that power we can determine the exponent and the mantissa. Call
+ * the value that has the number of bits to reach the power ebits. In the
+ * general case they have the following values:
+ *
+ *	exponent	127 + ebits
+ *	mantissa	value * 2^(23 - ebits) & 0x7fffff
+ *
+ * In the case where the value of ebits is <= -127 we are now in the case where
+ * we no longer have normalized numbers. In this case the values take on the
+ * following values:
+ *
+ * 	exponent	0
+ *	mantissa	value * 2^149 & 0x7fffff
+ *
+ * Once we have the values for the sign, mantissa, and exponent. We reconstruct
+ * the four bytes as follows:
+ *
+ *	byte0		sign bit and seven most significant bits from the exp
+ *			sign << 7 | (exponent & 0xfe) >>> 1
+ *
+ *	byte1		lsb from the exponent and 7 top bits from the mantissa
+ *			(exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16
+ *
+ *	byte2		bits 8-15 (zero indexing) from mantissa
+ *			mantissa & 0xff00 >> 8
+ *
+ *	byte3		bits 0-7 from mantissa
+ *			mantissa & 0xff
+ *
+ * Once we have this we have to assign them into the buffer in proper endian
+ * order.
+ */
+
+/*
+ * Compute the log base 2 of the value. Now, someone who remembers basic
+ * properties of logarithms will point out that we could use the change of base
+ * formula for logs, and in fact that would be astute, because that's what we'll
+ * do for now. It feels cleaner, albeit it may be less efficient than just
+ * iterating and dividing by 2. We may want to come back and revisit that some
+ * day.
+ */
+function log2(value)
+{
+	return (Math.log(value) / Math.log(2));
+}
+
+/*
+ * Helper to determine the exponent of the number we're looking at.
+ */
+function intexp(value)
+{
+	return (Math.floor(log2(value)));
+}
+
+/*
+ * Helper to determine the exponent of the fractional part of the value.
+ */
+function fracexp(value)
+{
+	return (Math.floor(log2(value)));
+}
+
+function wfloat(value, endian, buffer, offset)
+{
+	var sign, exponent, mantissa, ebits;
+	var bytes = [];
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+
+	if (offset + 3 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	if (isNaN(value)) {
+		sign = 0;
+		exponent = 0xff;
+		mantissa = 23;
+	} else if (value == Number.POSITIVE_INFINITY) {
+		sign = 0;
+		exponent = 0xff;
+		mantissa = 0;
+	} else if (value == Number.NEGATIVE_INFINITY) {
+		sign = 1;
+		exponent = 0xff;
+		mantissa = 0;
+	} else {
+		/* Well we have some work to do */
+
+		/* Thankfully the sign bit is trivial */
+		if (value < 0) {
+			sign = 1;
+			value = Math.abs(value);
+		} else {
+			sign = 0;
+		}
+
+		/* Use the correct function to determine number of bits */
+		if (value < 1)
+			ebits = fracexp(value);
+		else
+			ebits = intexp(value);
+
+		/* Time to deal with the issues surrounding normalization */
+		if (ebits <= -127) {
+			exponent = 0;
+			mantissa = (value * Math.pow(2, 149)) & 0x7fffff;
+		} else {
+			exponent = 127 + ebits;
+			mantissa = value * Math.pow(2, 23 - ebits);
+			mantissa &= 0x7fffff;
+		}
+	}
+
+	bytes[0] = sign << 7 | (exponent & 0xfe) >>> 1;
+	bytes[1] = (exponent & 0x01) << 7 | (mantissa & 0x7f0000) >>> 16;
+	bytes[2] = (mantissa & 0x00ff00) >>> 8;
+	bytes[3] = mantissa & 0x0000ff;
+
+	if (endian == 'big') {
+		buffer[offset] = bytes[0];
+		buffer[offset+1] = bytes[1];
+		buffer[offset+2] = bytes[2];
+		buffer[offset+3] = bytes[3];
+	} else {
+		buffer[offset] = bytes[3];
+		buffer[offset+1] = bytes[2];
+		buffer[offset+2] = bytes[1];
+		buffer[offset+3] = bytes[0];
+	}
+}
+
+/*
+ * Now we move onto doubles. Doubles are similar to floats in pretty much all
+ * ways except that the processing isn't quite as straightforward because we
+ * can't always use shifting, i.e. we have > 32 bit values.
+ *
+ * We're going to proceed in an identical fashion to floats and utilize the same
+ * helper functions. All that really is changing are the specific values that we
+ * use to do the calculations. Thus, to review we have to do the following.
+ *
+ * First get the sign bit and convert the value to its absolute value
+ * representation. Next, we determine the number of bits that we used to get to
+ * the value, branching whether the value is greater than or less than 1. Once
+ * we have that value which we will again call ebits, we have to do the
+ * following in the general case:
+ *
+ *	exponent	1023 + ebits
+ *	mantissa	[value * 2^(52 - ebits)] % 2^52
+ *
+ * In the case where the value of ebits <= -1023 we no longer use normalized
+ * numbers, thus like with floats we have to do slightly different processing:
+ *
+ *	exponent	0
+ *	mantissa	[value * 2^1074] % 2^52
+ *
+ * Once we have determined the sign, exponent and mantissa we can construct the
+ * bytes as follows:
+ *
+ *	byte0		sign bit and seven most significant bits form the exp
+ *			sign << 7 | (exponent & 0x7f0) >>> 4
+ *
+ *	byte1		Remaining 4 bits from the exponent and the four most
+ *			significant bits from the mantissa 48-51
+ *			(exponent & 0x00f) << 4 | mantissa >>> 48
+ *
+ *	byte2		Bits 40-47 from the mantissa
+ *			(mantissa >>> 40) & 0xff
+ *
+ *	byte3		Bits 32-39 from the mantissa
+ *			(mantissa >>> 32) & 0xff
+ *
+ *	byte4		Bits 24-31 from the mantissa
+ *			(mantissa >>> 24) & 0xff
+ *
+ *	byte5		Bits 16-23 from the Mantissa
+ *			(mantissa >>> 16) & 0xff
+ *
+ *	byte6		Bits 8-15 from the mantissa
+ *			(mantissa >>> 8) & 0xff
+ *
+ *	byte7		Bits 0-7 from the mantissa
+ *			mantissa & 0xff
+ *
+ * Now we can't quite do the right shifting that we want in bytes 1 - 3, because
+ * we'll have extended too far and we'll lose those values when we try and do
+ * the shift. Instead we have to use an alternate approach. To try and stay out
+ * of floating point, what we'll do is say that mantissa -= bytes[4-7] and then
+ * divide by 2^32. Once we've done that we can use binary arithmetic. Oof,
+ * that's ugly, but it seems to avoid using floating point (just based on how v8
+ * seems to be optimizing for base 2 arithmetic).
+ */
+function wdouble(value, endian, buffer, offset)
+{
+	var sign, exponent, mantissa, ebits;
+	var bytes = [];
+
+	if (value === undefined)
+		throw (new Error('missing value'));
+
+	if (endian === undefined)
+		throw (new Error('missing endian'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset'));
+
+
+	if (offset + 7 >= buffer.length)
+		throw (new Error('Trying to read beyond buffer length'));
+
+	if (isNaN(value)) {
+		sign = 0;
+		exponent = 0x7ff;
+		mantissa = 23;
+	} else if (value == Number.POSITIVE_INFINITY) {
+		sign = 0;
+		exponent = 0x7ff;
+		mantissa = 0;
+	} else if (value == Number.NEGATIVE_INFINITY) {
+		sign = 1;
+		exponent = 0x7ff;
+		mantissa = 0;
+	} else {
+		/* Well we have some work to do */
+
+		/* Thankfully the sign bit is trivial */
+		if (value < 0) {
+			sign = 1;
+			value = Math.abs(value);
+		} else {
+			sign = 0;
+		}
+
+		/* Use the correct function to determine number of bits */
+		if (value < 1)
+			ebits = fracexp(value);
+		else
+			ebits = intexp(value);
+
+		/*
+		 * This is a total hack to determine a denormalized value.
+		 * Unfortunately, we sometimes do not get a proper value for
+		 * ebits, i.e. we lose the values that would get rounded off.
+		 *
+		 *
+		 * The astute observer may wonder why we would be
+		 * multiplying by two Math.pows rather than just summing
+		 * them. Well, that's to get around a small bug in the
+		 * way v8 seems to implement the function. On occasion
+		 * doing:
+		 *
+		 * foo * Math.pow(2, 1023 + 51)
+		 *
+		 * Causes us to overflow to infinity, where as doing:
+		 *
+		 * foo * Math.pow(2, 1023) * Math.pow(2, 51)
+		 *
+		 * Does not cause us to overflow. Go figure.
+		 *
+		 */
+		if (value <= 2.225073858507201e-308 || ebits <= -1023) {
+			exponent = 0;
+			mantissa = value * Math.pow(2, 1023) * Math.pow(2, 51);
+			mantissa %= Math.pow(2, 52);
+		} else {
+			/*
+			 * We might have gotten fucked by our floating point
+			 * logarithm magic. This is rather crappy, but that's
+			 * our luck. If we just had a log base 2 or access to
+			 * the stupid underlying representation this would have
+			 * been much easier and we wouldn't have such stupid
+			 * kludges or hacks.
+			 */
+			if (ebits > 1023)
+				ebits = 1023;
+			exponent = 1023 + ebits;
+			mantissa = value * Math.pow(2, -ebits);
+			mantissa *= Math.pow(2, 52);
+			mantissa %= Math.pow(2, 52);
+		}
+	}
+
+	/* Fill the bytes in backwards to deal with the size issues */
+	bytes[7] = mantissa & 0xff;
+	bytes[6] = (mantissa >>> 8) & 0xff;
+	bytes[5] = (mantissa >>> 16) & 0xff;
+	mantissa = (mantissa - (mantissa & 0xffffff)) / Math.pow(2, 24);
+	bytes[4] = mantissa & 0xff;
+	bytes[3] = (mantissa >>> 8) & 0xff;
+	bytes[2] = (mantissa >>> 16) & 0xff;
+	bytes[1] = (exponent & 0x00f) << 4 | mantissa >>> 24;
+	bytes[0] = (sign << 7) | (exponent & 0x7f0) >>> 4;
+
+	if (endian == 'big') {
+		buffer[offset] = bytes[0];
+		buffer[offset+1] = bytes[1];
+		buffer[offset+2] = bytes[2];
+		buffer[offset+3] = bytes[3];
+		buffer[offset+4] = bytes[4];
+		buffer[offset+5] = bytes[5];
+		buffer[offset+6] = bytes[6];
+		buffer[offset+7] = bytes[7];
+	} else {
+		buffer[offset+7] = bytes[0];
+		buffer[offset+6] = bytes[1];
+		buffer[offset+5] = bytes[2];
+		buffer[offset+4] = bytes[3];
+		buffer[offset+3] = bytes[4];
+		buffer[offset+2] = bytes[5];
+		buffer[offset+1] = bytes[6];
+		buffer[offset] = bytes[7];
+	}
+}
+
+/*
+ * Actually export our work above. One might argue that we shouldn't expose
+ * these interfaces and just force people to use the higher level abstractions
+ * around this work. However, unlike say other libraries we've come across, this
+ * interface has several properties: it makes sense, it's simple, and it's
+ * useful.
+ */
+exports.ruint8 = ruint8;
+exports.ruint16 = ruint16;
+exports.ruint32 = ruint32;
+exports.ruint64 = ruint64;
+exports.wuint8 = wuint8;
+exports.wuint16 = wuint16;
+exports.wuint32 = wuint32;
+exports.wuint64 = wuint64;
+
+exports.rsint8 = rsint8;
+exports.rsint16 = rsint16;
+exports.rsint32 = rsint32;
+exports.rsint64 = rsint64;
+exports.wsint8 = wsint8;
+exports.wsint16 = wsint16;
+exports.wsint32 = wsint32;
+exports.wsint64 = wsint64;
+
+exports.rfloat = rfloat;
+exports.rdouble = rdouble;
+exports.wfloat = wfloat;
+exports.wdouble = wdouble;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/ctype.js	(revision 487)
@@ -0,0 +1,944 @@
+/*
+ * rm - Feb 2011
+ * ctype.js
+ *
+ * This module provides a simple abstraction towards reading and writing
+ * different types of binary data. It is designed to use ctio.js and provide a
+ * richer and more expressive API on top of it.
+ *
+ * By default we support the following as built in basic types:
+ *	int8_t
+ *	int16_t
+ *	int32_t
+ *	uint8_t
+ *	uint16_t
+ *	uint32_t
+ *	uint64_t
+ *	float
+ *	double
+ *	char
+ *	char[]
+ *
+ * Each type is returned as a Number, with the exception of char and char[]
+ * which are returned as Node Buffers. A char is considered a uint8_t.
+ *
+ * Requests to read and write data are specified as an array of JSON objects.
+ * This is also the same way that one declares structs. Even if just a single
+ * value is requested, it must be done as a struct. The array order determines
+ * the order that we try and read values. Each entry has the following format
+ * with values marked with a * being optional.
+ *
+ * { key: { type: /type/, value*: /value/, offset*: /offset/ }
+ *
+ * If offset is defined, we lseek(offset, SEEK_SET) before reading the next
+ * value. Value is defined when we're writing out data, otherwise it's ignored.
+ *
+ */
+
+var mod_ctf = require('./ctf.js');
+var mod_ctio = require('./ctio.js');
+var mod_assert = require('assert');
+
+/*
+ * This is the set of basic types that we support.
+ *
+ *	read		The function to call to read in a value from a buffer
+ *
+ *	write		The function to call to write a value to a buffer
+ *
+ */
+var deftypes = {
+    'uint8_t':  { read: ctReadUint8, write: ctWriteUint8 },
+    'uint16_t': { read: ctReadUint16, write: ctWriteUint16 },
+    'uint32_t': { read: ctReadUint32, write: ctWriteUint32 },
+    'uint64_t': { read: ctReadUint64, write: ctWriteUint64 },
+    'int8_t': { read: ctReadSint8, write: ctWriteSint8 },
+    'int16_t': { read: ctReadSint16, write: ctWriteSint16 },
+    'int32_t': { read: ctReadSint32, write: ctWriteSint32 },
+    'int64_t': { read: ctReadSint64, write: ctWriteSint64 },
+    'float': { read: ctReadFloat, write: ctWriteFloat },
+    'double': { read: ctReadDouble, write: ctWriteDouble },
+    'char': { read: ctReadChar, write: ctWriteChar },
+    'char[]': { read: ctReadCharArray, write: ctWriteCharArray }
+};
+
+/*
+ * The following are wrappers around the CType IO low level API. They encode
+ * knowledge about the size and return something in the expected format.
+ */
+function ctReadUint8(endian, buffer, offset)
+{
+	var val = mod_ctio.ruint8(buffer, endian, offset);
+	return ({ value: val, size: 1 });
+}
+
+function ctReadUint16(endian, buffer, offset)
+{
+	var val = mod_ctio.ruint16(buffer, endian, offset);
+	return ({ value: val, size: 2 });
+}
+
+function ctReadUint32(endian, buffer, offset)
+{
+	var val = mod_ctio.ruint32(buffer, endian, offset);
+	return ({ value: val, size: 4 });
+}
+
+function ctReadUint64(endian, buffer, offset)
+{
+	var val = mod_ctio.ruint64(buffer, endian, offset);
+	return ({ value: val, size: 8 });
+}
+
+function ctReadSint8(endian, buffer, offset)
+{
+	var val = mod_ctio.rsint8(buffer, endian, offset);
+	return ({ value: val, size: 1 });
+}
+
+function ctReadSint16(endian, buffer, offset)
+{
+	var val = mod_ctio.rsint16(buffer, endian, offset);
+	return ({ value: val, size: 2 });
+}
+
+function ctReadSint32(endian, buffer, offset)
+{
+	var val = mod_ctio.rsint32(buffer, endian, offset);
+	return ({ value: val, size: 4 });
+}
+
+function ctReadSint64(endian, buffer, offset)
+{
+	var val = mod_ctio.rsint64(buffer, endian, offset);
+	return ({ value: val, size: 8 });
+}
+
+function ctReadFloat(endian, buffer, offset)
+{
+	var val = mod_ctio.rfloat(buffer, endian, offset);
+	return ({ value: val, size: 4 });
+}
+
+function ctReadDouble(endian, buffer, offset)
+{
+	var val = mod_ctio.rdouble(buffer, endian, offset);
+	return ({ value: val, size: 8 });
+}
+
+/*
+ * Reads a single character into a node buffer
+ */
+function ctReadChar(endian, buffer, offset)
+{
+	var res = new Buffer(1);
+	res[0] = mod_ctio.ruint8(buffer, endian, offset);
+	return ({ value: res, size: 1 });
+}
+
+function ctReadCharArray(length, endian, buffer, offset)
+{
+	var ii;
+	var res = new Buffer(length);
+
+	for (ii = 0; ii < length; ii++)
+		res[ii] = mod_ctio.ruint8(buffer, endian, offset + ii);
+
+	return ({ value: res, size: length });
+}
+
+function ctWriteUint8(value, endian, buffer, offset)
+{
+	mod_ctio.wuint8(value, endian, buffer, offset);
+	return (1);
+}
+
+function ctWriteUint16(value, endian, buffer, offset)
+{
+	mod_ctio.wuint16(value, endian, buffer, offset);
+	return (2);
+}
+
+function ctWriteUint32(value, endian, buffer, offset)
+{
+	mod_ctio.wuint32(value, endian, buffer, offset);
+	return (4);
+}
+
+function ctWriteUint64(value, endian, buffer, offset)
+{
+	mod_ctio.wuint64(value, endian, buffer, offset);
+	return (8);
+}
+
+function ctWriteSint8(value, endian, buffer, offset)
+{
+	mod_ctio.wsint8(value, endian, buffer, offset);
+	return (1);
+}
+
+function ctWriteSint16(value, endian, buffer, offset)
+{
+	mod_ctio.wsint16(value, endian, buffer, offset);
+	return (2);
+}
+
+function ctWriteSint32(value, endian, buffer, offset)
+{
+	mod_ctio.wsint32(value, endian, buffer, offset);
+	return (4);
+}
+
+function ctWriteSint64(value, endian, buffer, offset)
+{
+	mod_ctio.wsint64(value, endian, buffer, offset);
+	return (8);
+}
+
+function ctWriteFloat(value, endian, buffer, offset)
+{
+	mod_ctio.wfloat(value, endian, buffer, offset);
+	return (4);
+}
+
+function ctWriteDouble(value, endian, buffer, offset)
+{
+	mod_ctio.wdouble(value, endian, buffer, offset);
+	return (8);
+}
+
+/*
+ * Writes a single character into a node buffer
+ */
+function ctWriteChar(value, endian, buffer, offset)
+{
+	if (!(value instanceof Buffer))
+		throw (new Error('Input must be a buffer'));
+
+	mod_ctio.ruint8(value[0], endian, buffer, offset);
+	return (1);
+}
+
+/*
+ * We're going to write 0s into the buffer if the string is shorter than the
+ * length of the array.
+ */
+function ctWriteCharArray(value, length, endian, buffer, offset)
+{
+	var ii;
+
+	if (!(value instanceof Buffer))
+		throw (new Error('Input must be a buffer'));
+
+	if (value.length > length)
+		throw (new Error('value length greater than array length'));
+
+	for (ii = 0; ii < value.length && ii < length; ii++)
+		mod_ctio.wuint8(value[ii], endian, buffer, offset + ii);
+
+	for (; ii < length; ii++)
+		mod_ctio.wuint8(0, endian, offset + ii);
+
+
+	return (length);
+}
+
+/*
+ * Each parser has their own set of types. We want to make sure that they each
+ * get their own copy as they may need to modify it.
+ */
+function ctGetBasicTypes()
+{
+	var ret = {};
+	var key;
+	for (key in deftypes)
+		ret[key] = deftypes[key];
+
+	return (ret);
+}
+
+/*
+ * Given a string in the form of type[length] we want to split this into an
+ * object that extracts that information. We want to note that we could possibly
+ * have nested arrays so this should only check the furthest one. It may also be
+ * the case that we have no [] pieces, in which case we just return the current
+ * type.
+ */
+function ctParseType(str)
+{
+	var begInd, endInd;
+	var type, len;
+	if (typeof (str) != 'string')
+		throw (new Error('type must be a Javascript string'));
+
+	endInd = str.lastIndexOf(']');
+	if (endInd == -1) {
+		if (str.lastIndexOf('[') != -1)
+			throw (new Error('found invalid type with \'[\' but ' +
+			    'no corresponding \']\''));
+
+		return ({ type: str });
+	}
+
+	begInd = str.lastIndexOf('[');
+	if (begInd == -1)
+		throw (new Error('found invalid type with \']\' but ' +
+		    'no corresponding \'[\''));
+
+	if (begInd >= endInd)
+		throw (new Error('malformed type, \']\' appears before \'[\''));
+
+	type = str.substring(0, begInd);
+	len = str.substring(begInd + 1, endInd);
+
+	return ({ type: type, len: len });
+}
+
+/*
+ * Given a request validate that all of the fields for it are valid and make
+ * sense. This includes verifying the following notions:
+ *  - Each type requested is present in types
+ *  - Only allow a name for a field to be specified once
+ *  - If an array is specified, validate that the requested field exists and
+ *    comes before it.
+ *  - If fields is defined, check that each entry has the occurrence of field
+ */
+function ctCheckReq(def, types, fields)
+{
+	var ii, jj;
+	var req, keys, key;
+	var found = {};
+
+	if (!(def instanceof Array))
+		throw (new Error('definition is not an array'));
+
+	if (def.length === 0)
+		throw (new Error('definition must have at least one element'));
+
+	for (ii = 0; ii < def.length; ii++) {
+		req = def[ii];
+		if (!(req instanceof Object))
+			throw (new Error('definition must be an array of' +
+			    'objects'));
+
+		keys = Object.keys(req);
+		if (keys.length != 1)
+			throw (new Error('definition entry must only have ' +
+			    'one key'));
+
+		if (keys[0] in found)
+			throw (new Error('Specified name already ' +
+			    'specified: ' + keys[0]));
+
+		if (!('type' in req[keys[0]]))
+			throw (new Error('missing required type definition'));
+
+		key = ctParseType(req[keys[0]]['type']);
+
+		/*
+		 * We may have nested arrays, we need to check the validity of
+		 * the types until the len field is undefined in key. However,
+		 * each time len is defined we need to verify it is either an
+		 * integer or corresponds to an already seen key.
+		 */
+		while (key['len'] !== undefined) {
+			if (isNaN(parseInt(key['len'], 10))) {
+				if (!(key['len'] in found))
+					throw (new Error('Given an array ' +
+					    'length without a matching type'));
+
+			}
+
+			key = ctParseType(key['type']);
+		}
+
+		/* Now we can validate if the type is valid */
+		if (!(key['type'] in types))
+			throw (new Error('type not found or typdefed: ' +
+			    key['type']));
+
+		/* Check for any required fields */
+		if (fields !== undefined) {
+			for (jj = 0; jj < fields.length; jj++) {
+				if (!(fields[jj] in req[keys[0]]))
+					throw (new Error('Missing required ' +
+					    'field: ' + fields[jj]));
+			}
+		}
+
+		found[keys[0]] = true;
+	}
+}
+
+
+/*
+ * Create a new instance of the parser. Each parser has its own store of
+ * typedefs and endianness. Conf is an object with the following required
+ * values:
+ *
+ *	endian		Either 'big' or 'little' do determine the endianness we
+ *			want to read from or write to.
+ *
+ * And the following optional values:
+ *
+ * 	char-type	Valid options here are uint8 and int8. If uint8 is
+ * 			specified this changes the default behavior of a single
+ * 			char from being a buffer of a single character to being
+ * 			a uint8_t. If int8, it becomes an int8_t instead.
+ */
+function CTypeParser(conf)
+{
+	if (!conf) throw (new Error('missing required argument'));
+
+	if (!('endian' in conf))
+		throw (new Error('missing required endian value'));
+
+	if (conf['endian'] != 'big' && conf['endian'] != 'little')
+		throw (new Error('Invalid endian type'));
+
+	if ('char-type' in conf && (conf['char-type'] != 'uint8' &&
+	    conf['char-type'] != 'int8'))
+		throw (new Error('invalid option for char-type: ' +
+		    conf['char-type']));
+
+	this.endian = conf['endian'];
+	this.types = ctGetBasicTypes();
+
+	/*
+	 * There may be a more graceful way to do this, but this will have to
+	 * serve.
+	 */
+	if ('char-type' in conf && conf['char-type'] == 'uint8')
+		this.types['char'] = this.types['uint8_t'];
+
+	if ('char-type' in conf && conf['char-type'] == 'int8')
+		this.types['char'] = this.types['int8_t'];
+}
+
+/*
+ * Sets the current endian value for the Parser. If the value is not valid,
+ * throws an Error.
+ *
+ *	endian		Either 'big' or 'little' do determine the endianness we
+ *			want to read from or write to.
+ *
+ */
+CTypeParser.prototype.setEndian = function (endian)
+{
+	if (endian != 'big' && endian != 'little')
+		throw (new Error('invalid endian type, must be big or ' +
+		    'little'));
+
+	this.endian = endian;
+};
+
+/*
+ * Returns the current value of the endian value for the parser.
+ */
+CTypeParser.prototype.getEndian = function ()
+{
+	return (this.endian);
+};
+
+/*
+ * A user has requested to add a type, let us honor their request. Yet, if their
+ * request doth spurn us, send them unto the Hells which Dante describes.
+ *
+ * 	name		The string for the type definition we're adding
+ *
+ *	value		Either a string that is a type/array name or an object
+ *			that describes a struct.
+ */
+CTypeParser.prototype.typedef = function (name, value)
+{
+	var type;
+
+	if (name === undefined)
+		throw (new (Error('missing required typedef argument: name')));
+
+	if (value === undefined)
+		throw (new (Error('missing required typedef argument: value')));
+
+	if (typeof (name) != 'string')
+		throw (new (Error('the name of a type must be a string')));
+
+	type = ctParseType(name);
+
+	if (type['len'] !== undefined)
+		throw (new Error('Cannot have an array in the typedef name'));
+
+	if (name in this.types)
+		throw (new Error('typedef name already present: ' + name));
+
+	if (typeof (value) != 'string' && !(value instanceof Array))
+		throw (new Error('typedef value must either be a string or ' +
+		    'struct'));
+
+	if (typeof (value) == 'string') {
+		type = ctParseType(value);
+		if (type['len'] !== undefined) {
+			if (isNaN(parseInt(type['len'], 10)))
+				throw (new (Error('typedef value must use ' +
+				    'fixed size array when outside of a ' +
+				    'struct')));
+		}
+
+		this.types[name] = value;
+	} else {
+		/* We have a struct, validate it */
+		ctCheckReq(value, this.types);
+		this.types[name] = value;
+	}
+};
+
+/*
+ * Include all of the typedefs, but none of the built in types. This should be
+ * treated as read-only.
+ */
+CTypeParser.prototype.lstypes = function ()
+{
+	var key;
+	var ret = {};
+
+	for (key in this.types) {
+		if (key in deftypes)
+			continue;
+		ret[key] = this.types[key];
+	}
+
+	return (ret);
+};
+
+/*
+ * Given a type string that may have array types that aren't numbers, try and
+ * fill them in from the values object. The object should be of the format where
+ * indexing into it should return a number for that type.
+ *
+ *	str		The type string
+ *
+ *	values		An object that can be used to fulfill type information
+ */
+function ctResolveArray(str, values)
+{
+	var ret = '';
+	var type = ctParseType(str);
+
+	while (type['len'] !== undefined) {
+		if (isNaN(parseInt(type['len'], 10))) {
+			if (typeof (values[type['len']]) != 'number')
+				throw (new Error('cannot sawp in non-number ' +
+				    'for array value'));
+			ret = '[' + values[type['len']] + ']' + ret;
+		} else {
+			ret = '[' + type['len'] + ']' + ret;
+		}
+		type = ctParseType(type['type']);
+	}
+
+	ret = type['type'] + ret;
+
+	return (ret);
+}
+
+/*
+ * [private] Either the typedef resolves to another type string or to a struct.
+ * If it resolves to a struct, we just pass it off to read struct. If not, we
+ * can just pass it off to read entry.
+ */
+CTypeParser.prototype.resolveTypedef = function (type, dispatch, buffer,
+    offset, value)
+{
+	var pt;
+
+	mod_assert.ok(type in this.types);
+	if (typeof (this.types[type]) == 'string') {
+		pt = ctParseType(this.types[type]);
+		if (dispatch == 'read')
+			return (this.readEntry(pt, buffer, offset));
+		else if (dispatch == 'write')
+			return (this.writeEntry(value, pt, buffer, offset));
+		else
+			throw (new Error('invalid dispatch type to ' +
+			    'resolveTypedef'));
+	} else {
+		if (dispatch == 'read')
+			return (this.readStruct(this.types[type], buffer,
+			    offset));
+		else if (dispatch == 'write')
+			return (this.writeStruct(value, this.types[type],
+			    buffer, offset));
+		else
+			throw (new Error('invalid dispatch type to ' +
+			    'resolveTypedef'));
+	}
+
+};
+
+/*
+ * [private] Try and read in the specific entry.
+ */
+CTypeParser.prototype.readEntry = function (type, buffer, offset)
+{
+	var parse, len;
+
+	/*
+	 * Because we want to special case char[]s this is unfortunately
+	 * a bit uglier than it really should be. We want to special
+	 * case char[]s so that we return a node buffer, thus they are a
+	 * first class type where as all other arrays just call into a
+	 * generic array routine which calls their data-specific routine
+	 * the specified number of times.
+	 *
+	 * The valid dispatch options we have are:
+	 *  - Array and char => char[] handler
+	 *  - Generic array handler
+	 *  - Generic typedef handler
+	 *  - Basic type handler
+	 */
+	if (type['len'] !== undefined) {
+		len = parseInt(type['len'], 10);
+		if (isNaN(len))
+			throw (new Error('somehow got a non-numeric length'));
+
+		if (type['type'] == 'char')
+			parse = this.types['char[]']['read'](len,
+			    this.endian, buffer, offset);
+		else
+			parse = this.readArray(type['type'],
+			    len, buffer, offset);
+	} else {
+		if (type['type'] in deftypes)
+			parse = this.types[type['type']]['read'](this.endian,
+			    buffer, offset);
+		else
+			parse = this.resolveTypedef(type['type'], 'read',
+			    buffer, offset);
+	}
+
+	return (parse);
+};
+
+/*
+ * [private] Read an array of data
+ */
+CTypeParser.prototype.readArray = function (type, length, buffer, offset)
+{
+	var ii, ent, pt;
+	var baseOffset = offset;
+	var ret = new Array(length);
+	pt = ctParseType(type);
+
+	for (ii = 0; ii < length; ii++) {
+		ent = this.readEntry(pt, buffer, offset);
+		offset += ent['size'];
+		ret[ii] = ent['value'];
+	}
+
+	return ({ value: ret, size: offset - baseOffset });
+};
+
+/*
+ * [private] Read a single struct in.
+ */
+CTypeParser.prototype.readStruct = function (def, buffer, offset)
+{
+	var parse, ii, type, entry, key;
+	var baseOffset = offset;
+	var ret = {};
+
+	/* Walk it and handle doing what's necessary */
+	for (ii = 0; ii < def.length; ii++) {
+		key = Object.keys(def[ii])[0];
+		entry = def[ii][key];
+
+		/* Resolve all array values */
+		type = ctParseType(ctResolveArray(entry['type'], ret));
+
+		if ('offset' in entry)
+			offset = baseOffset + entry['offset'];
+
+		parse = this.readEntry(type, buffer, offset);
+
+		offset += parse['size'];
+		ret[key] = parse['value'];
+	}
+
+	return ({ value: ret, size: (offset-baseOffset)});
+};
+
+/*
+ * This is what we were born to do. We read the data from a buffer and return it
+ * in an object whose keys match the values from the object.
+ *
+ *	def		The array definition of the data to read in
+ *
+ *	buffer		The buffer to read data from
+ *
+ *	offset		The offset to start writing to
+ *
+ * Returns an object where each key corresponds to an entry in def and the value
+ * is the read value.
+ */
+CTypeParser.prototype.readData = function (def, buffer, offset)
+{
+	/* Sanity check for arguments */
+	if (def === undefined)
+		throw (new Error('missing definition for what we should be' +
+		    'parsing'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer for what we should be ' +
+		    'parsing'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset for what we should be ' +
+		    'parsing'));
+
+	/* Sanity check the object definition */
+	ctCheckReq(def, this.types);
+
+	return (this.readStruct(def, buffer, offset)['value']);
+};
+
+/*
+ * [private] Write out an array of data
+ */
+CTypeParser.prototype.writeArray = function (value, type, length, buffer,
+    offset)
+{
+	var ii, pt;
+	var baseOffset = offset;
+	if (!(value instanceof Array))
+		throw (new Error('asked to write an array, but value is not ' +
+		    'an array'));
+
+	if (value.length != length)
+		throw (new Error('asked to write array of length ' + length +
+		    ' but that does not match value length: ' + value.length));
+
+	pt = ctParseType(type);
+	for (ii = 0; ii < length; ii++)
+		offset += this.writeEntry(value[ii], pt, buffer, offset);
+
+	return (offset - baseOffset);
+};
+
+/*
+ * [private] Write the specific entry
+ */
+CTypeParser.prototype.writeEntry = function (value, type, buffer, offset)
+{
+	var len, ret;
+
+	if (type['len'] !== undefined) {
+		len = parseInt(type['len'], 10);
+		if (isNaN(len))
+			throw (new Error('somehow got a non-numeric length'));
+
+		if (type['type'] == 'char')
+			ret = this.types['char[]']['write'](value, len,
+			    this.endian, buffer, offset);
+		else
+			ret = this.writeArray(value, type['type'],
+			    len, buffer, offset);
+	} else {
+		if (type['type'] in deftypes)
+			ret = this.types[type['type']]['write'](value,
+			    this.endian, buffer, offset);
+		else
+			ret = this.resolveTypedef(type['type'], 'write',
+			    buffer, offset, value);
+	}
+
+	return (ret);
+};
+
+/*
+ * [private] Write a single struct out.
+ */
+CTypeParser.prototype.writeStruct = function (value, def, buffer, offset)
+{
+	var ii, entry, type, key;
+	var baseOffset = offset;
+	var vals = {};
+
+	for (ii = 0; ii < def.length; ii++) {
+		key = Object.keys(def[ii])[0];
+		entry = def[ii][key];
+
+		type = ctParseType(ctResolveArray(entry['type'], vals));
+
+		if ('offset' in entry)
+			offset = baseOffset + entry['offset'];
+
+		offset += this.writeEntry(value[ii], type, buffer, offset);
+		/* Now that we've written it out, we can use it for arrays */
+		vals[key] = value[ii];
+	}
+
+	return (offset);
+};
+
+/*
+ * Unfortunately, we're stuck with the sins of an initial poor design. Because
+ * of that, we are going to have to support the old way of writing data via
+ * writeData. There we insert the values that you want to write into the
+ * definition. A little baroque. Internally, we use the new model. So we need to
+ * just get those values out of there. But to maintain the principle of least
+ * surprise, we're not going to modify the input data.
+ */
+function getValues(def)
+{
+	var ii, out, key;
+	out = [];
+	for (ii = 0; ii < def.length; ii++) {
+		key = Object.keys(def[ii])[0];
+		mod_assert.ok('value' in def[ii][key]);
+		out.push(def[ii][key]['value']);
+	}
+
+	return (out);
+}
+
+/*
+ * This is the second half of what we were born to do, write out the data
+ * itself. Historically this function required you to put your values in the
+ * definition section. This was not the smartest thing to do and a bit of an
+ * oversight to be honest. As such, this function now takes a values argument.
+ * If values is non-null and non-undefined, it will be used to determine the
+ * values. This means that the old method is still supported, but is no longer
+ * acceptable.
+ *
+ *	def		The array definition of the data to write out with
+ *			values
+ *
+ *	buffer		The buffer to write to
+ *
+ *	offset		The offset in the buffer to write to
+ *
+ *	values		An array of values to write.
+ */
+CTypeParser.prototype.writeData = function (def, buffer, offset, values)
+{
+	var hv;
+
+	if (def === undefined)
+		throw (new Error('missing definition for what we should be' +
+		    'parsing'));
+
+	if (buffer === undefined)
+		throw (new Error('missing buffer for what we should be ' +
+		    'parsing'));
+
+	if (offset === undefined)
+		throw (new Error('missing offset for what we should be ' +
+		    'parsing'));
+
+	hv = (values != null && values != undefined);
+	if (hv) {
+		if (!Array.isArray(values))
+			throw (new Error('missing values for writing'));
+		ctCheckReq(def, this.types);
+	} else {
+		ctCheckReq(def, this.types, [ 'value' ]);
+	}
+
+	this.writeStruct(hv ? values : getValues(def), def, buffer, offset);
+};
+
+/*
+ * Functions to go to and from 64 bit numbers in a way that is compatible with
+ * Javascript limitations. There are two sets. One where the user is okay with
+ * an approximation and one where they are definitely not okay with an
+ * approximation.
+ */
+
+/*
+ * Attempts to convert an array of two integers returned from rsint64 / ruint64
+ * into an absolute 64 bit number. If however the value would exceed 2^52 this
+ * will instead throw an error. The mantissa in a double is a 52 bit number and
+ * rather than potentially give you a value that is an approximation this will
+ * error. If you would rather an approximation, please see toApprox64.
+ *
+ *	val		An array of two 32-bit integers
+ */
+function toAbs64(val)
+{
+	if (val === undefined)
+		throw (new Error('missing required arg: value'));
+
+	if (!Array.isArray(val))
+		throw (new Error('value must be an array'));
+
+	if (val.length != 2)
+		throw (new Error('value must be an array of length 2'));
+
+	/* We have 20 bits worth of precision in this range */
+	if (val[0] >= 0x100000)
+		throw (new Error('value would become approximated'));
+
+	return (val[0] * Math.pow(2, 32) + val[1]);
+}
+
+/*
+ * Will return the 64 bit value as returned in an array from rsint64 / ruint64
+ * to a value as close as it can. Note that Javascript stores all numbers as a
+ * double and the mantissa only has 52 bits. Thus this version may approximate
+ * the value.
+ *
+ *	val		An array of two 32-bit integers
+ */
+function toApprox64(val)
+{
+	if (val === undefined)
+		throw (new Error('missing required arg: value'));
+
+	if (!Array.isArray(val))
+		throw (new Error('value must be an array'));
+
+	if (val.length != 2)
+		throw (new Error('value must be an array of length 2'));
+
+	return (Math.pow(2, 32) * val[0] + val[1]);
+}
+
+function parseCTF(json, conf)
+{
+	var ctype = new CTypeParser(conf);
+	mod_ctf.ctfParseJson(json, ctype);
+
+	return (ctype);
+}
+
+/*
+ * Export the few things we actually want to. Currently this is just the CType
+ * Parser and ctio.
+ */
+exports.Parser = CTypeParser;
+exports.toAbs64 = toAbs64;
+exports.toApprox64 = toApprox64;
+
+exports.parseCTF = parseCTF;
+
+exports.ruint8 = mod_ctio.ruint8;
+exports.ruint16 = mod_ctio.ruint16;
+exports.ruint32 = mod_ctio.ruint32;
+exports.ruint64 = mod_ctio.ruint64;
+exports.wuint8 = mod_ctio.wuint8;
+exports.wuint16 = mod_ctio.wuint16;
+exports.wuint32 = mod_ctio.wuint32;
+exports.wuint64 = mod_ctio.wuint64;
+
+exports.rsint8 = mod_ctio.rsint8;
+exports.rsint16 = mod_ctio.rsint16;
+exports.rsint32 = mod_ctio.rsint32;
+exports.rsint64 = mod_ctio.rsint64;
+exports.wsint8 = mod_ctio.wsint8;
+exports.wsint16 = mod_ctio.wsint16;
+exports.wsint32 = mod_ctio.wsint32;
+exports.wsint64 = mod_ctio.wsint64;
+
+exports.rfloat = mod_ctio.rfloat;
+exports.rdouble = mod_ctio.rdouble;
+exports.wfloat = mod_ctio.wfloat;
+exports.wdouble = mod_ctio.wdouble;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/man/man3ctype/ctio.3ctype	(revision 487)
@@ -0,0 +1,241 @@
+'\" te
+.\" Copyright (c) 2011, Robert Mustacchi.  All Rights Reserved.
+.\" Copyright (c) 2011, Joyent, Inc.  All Rights Reserved.
+.\"
+.\" Permission is hereby granted, free of charge, to any person obtaining a copy
+.\" of this software and associated documentation files (the "Software"), to
+.\" deal in the Software without restriction, including without limitation the
+.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+.\" sell copies of the Software, and to permit persons to whom the Software is
+.\" furnished to do so, subject to the following conditions:
+.\"
+.\" The above copyright notice and this permission notice shall be included in
+.\" all copies or substantial portions of the Software.
+.\" 
+.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+.\" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+.\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+.\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+.\" IN THE SOFTWARE.
+.TH CTIO 3CTYPE "December 12, 2011"
+.SH NAME
+ctio, ruint8, ruint16, ruint32, ruint64, wuint8, wuint16, wuint32, wuint64,
+rsint8, rsint16, rsint32, rsint64, wsint8, wsint16, wsint32, wsint64, rfloat,
+rdouble, wfloat, wdouble \- integer and float operations
+.SH SYNOPSIS
+.LP
+.nf
+var mod_ctype = require('ctype');
+
+\fBNumber\fR \fBmod_ctype.ruint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.ruint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.ruint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber[2]\fR \fBmod_ctype.ruint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint8\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint16\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rsint32\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber[2]\fR \fBmod_ctype.rsint64\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rfloat\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBNumber\fR \fBmod_ctype.rdouble\fR(\fBBuffer\fR \fIbuf\fR, \fBString\fR \fIendian\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wuint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint8\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint16\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint32\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wsint64\fR(\fBNumber[2]\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wfloat\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.LP
+.nf
+\fBvoid\fR \fBmod_ctype.wdouble\fR(\fBNumber\fR value, \fBString\fR \fIendian\fR, \fBBuffer\fR \fIbuf\fR, \fBNumber\fR \fIoffset\fR);
+.fi
+
+.SH DESCRIPTION
+.sp
+.LP
+The argument \fIbuf\fR refers to a valid buffer (from calling new Buffer()). The
+argument \fIendian\fR is either the string 'big' or 'little' and controls
+whether the data in the buffer is interpreted as big or little endian. The argument
+\fIoffset\fR indicates the starting index into the buffer to read or write. All
+functions ensure that starting at \fIoffset\fR does not overflow the end of the
+buffer. The argument \fIvalue\fR is a Number that is the valid type for the
+specific function. All functions that take \fIvalue\fR as an argument, verify
+that the passed value is valid.
+
+.SS "\fBruint8()\fR, \fBruint16()\fR, \fBruint32()\fR"
+.sp
+.LP
+The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions read an 8,
+16, and 32-bit unsigned value from \fIbuf\fR and return it. The value read is
+influenced by the values of \fIoffset\fR and \fRendian\fI.
+
+
+.SS "\fBrsint8()\fR, \fBrsint16()\fR, \fBrsint32()\fR"
+.sp
+.LP
+The \fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR functions work just as
+\fBruint8()\fR, \fBruint16()\fR, and \fBruint32()\fR, except they return signed
+integers.
+
+.SS "\fBruint64()\fR, \fBrsint64()\fR"
+.sp
+.LP
+The \fBruint64()\fR and \fBrsint64()\fR functions read unsigned and signed 64
+bit integers respectively from \fBbuf\fR. Due to the limitations of ECMAScript's
+\fBNumber\fR type, they cannot be stored as one value without a loss of
+precision. Instead of returning the values as a single \fBNumber\fR, the
+functions return an array of two numbers. The first entry always contains the
+upper 32-bits and the second value contains the lower 32-bits. The lossy
+transformation into a number would be \fIres[0]*Math.pow(2,32)+res[1]\fR.
+Note that, unless an entry is zero, both array entries are guaranteed to have
+the same sign.
+
+.SS "\fBwuint8()\fR, \fBwuint16()\fR, \fBwuint32()\fR"
+.sp
+.LP
+The functions \fBwuint8()\fR, \fBwuint16()\fR, and \fBwuint32()\fR modify the
+contents of \fBbuf\fR by writing an 8, 16, and 32-bit unsigned integer
+respectively to \fBbuf\fR. It is illegal to pass a number that is not an integer
+within the domain of the integer size, for example, for \fBwuint8()\fR the valid
+range is \fB[0, 255]\fR. The value will be written in either big or little
+endian format based upon the value of \fBendian\fR.
+
+
+.SS "\fBwsint8()\fR, \fBwsint16()\fR, \fBwsint32()\fR"
+.sp
+.LP
+The functions \fBwsint8()\fR, \fBwsint16()\fR, and \fBwsint32()\fR function
+identically to the functions \fBwuint8()\fR, \fBwuint16()\fR, and
+\fBwuint32()\fR except that they the valid domain for \fBvalue\fR is that of a
+signed number instead of an unsigned number. For example the \fBwsint8()\fR has
+a domain of \fB[-128, 127]\fR.
+
+.SS "\fBwuint64()\fR, \fBwsint64()\fR"
+.sp
+.LP
+The functions \fBwuint64()\fR and \fBswint64()\fR write out 64-bit unsigned and
+signed integers to \fBbuf\fR. The \fBvalue\fR argument must be in the same
+format as described in \fBruint64()\fR and \fBrsint64()\fR.
+
+.SS "\fBrfloat()\fR, \fBrdouble()\fR"
+.sp
+.LP
+The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other read
+functions, except that they read a single precision and double precision
+IEEE-754 floating point value instead.
+
+.SS "\fBwfloat()\fR, \fBwdouble()\fR"
+.sp
+.LP
+The functions "\fBrfloat()\fR and \fBrdouble()\fR" work like the other write 
+functions, except that the domain for a float is that of a single precision 4
+byte value. The domain for a double is any \fBNumber\fR in ECMAScript, which is
+defined to be represented by a double.
+
+.SH ATTRIBUTES
+.sp
+.LP
+See \fBattributes\fR(5) for descriptions of the following attributes:
+.sp
+
+.sp
+.TS
+box;
+c | c
+l | l .
+ATTRIBUTE TYPE	ATTRIBUTE VALUE
+_
+Interface Stability	Committed
+_
+MT-Level	See below.
+_
+Standard	Not standardized.
+.TE
+
+.sp
+.LP
+
+All functions are MT-safe in so far as there aren't shared memory MT concerns in
+most node programs. If one where to concoct such an environment, these functions
+wouldn't be MT-safe.
+
+.SH SEE ALSO
+.sp
+.LP
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json	(revision 487)
@@ -0,0 +1,22 @@
+{
+  "name": "ctype",
+  "version": "0.5.2",
+  "description": "read and write binary structures and data types",
+  "homepage": "https://github.com/rmustacc/node-ctype",
+  "author": {
+    "name": "Robert Mustacchi",
+    "email": "rm@fingolfin.org"
+  },
+  "engines": {
+    "node": ">= 0.4"
+  },
+  "main": "ctype.js",
+  "readme": "Node-CType is a way to read and write binary data in structured and easy to use\nformat. Its name comes from the C header file.\n\nTo get started, simply clone the repository or use npm to install it. Once it is\nthere, simply require it.\n\ngit clone git://github.com/rmustacc/node-ctype\nnpm install ctype\nvar mod_ctype = require('ctype')\n\n\nThere are two APIs that you can use, depending on what abstraction you'd like.\nThe low level API let's you read and write individual integers and floats from\nbuffers. The higher level API let's you read and write structures of these. To\nillustrate this, let's looks look at how we would read and write a binary\nencoded x,y point.\n\nIn C we would define this structure as follows:\n\ntypedef struct point {\n\tuint16_t\tp_x;\n\tuint16_t\tp_y;\n} point_t;\n\nTo read a binary encoded point from a Buffer, we first need to create a CType\nparser (where we specify the endian and other options) and add the typedef.\n\nvar parser = new mod_ctype.Parser({ endian: 'big' });\nparser.typedef('point_t', [\n\t{ x: { type: 'uint16_t' } },\n\t{ y: { type: 'uint16_t' } }\n]);\n\nFrom here, given a buffer buf and an offset into it, we can read a point.\n\nvar out = parser.readData([ { point: { type: 'point_t' } } ], buffer, 0);\nconsole.log(out);\n{ point: { x: 23, y: 42 } }\n\nAnother way to get the same information would be to use the low level methods.\nNote that these require you to manually deal with the offset. Here's how we'd\nget the same values of x and y from the buffer.\n\nvar x = mod_ctype.ruint16(buf, 'big', 0);\nvar y = mod_ctype.ruint16(buf, 'big', 2);\nconsole.log(x + ', ' + y);\n23, 42\n\nThe true power of this API comes from the ability to define and nest typedefs,\njust as you would in C. By default, the following types are defined by default.\nNote that they return a Number, unless indicated otherwise.\n\n    * int8_t\n    * int16_t\n    * int32_t\n    * int64_t (returns an array where val[0] << 32 + val[1] would be the value)\n    * uint8_t\n    * uint16_t\n    * uint32_t\n    * uint64_t (returns an array where val[0] << 32 + val[1] would be the value)\n    * float\n    * double\n    * char (either returns a buffer with that character or a uint8_t)\n    * char[] (returns an object with the buffer and the number of characters read which is either the total amount requested or until the first 0)\n\n\nctf2json integration:\n\nNode-CType supports consuming the output of ctf2json. Once you read in a JSON file,\nall you have to do to add all the definitions it contains is:\n\nvar data, parser;\ndata = JSON.parse(parsedJSONData);\nparser = mod_ctype.parseCTF(data, { endian: 'big' });\n\nFor more documentation, see the file README.old. Full documentation is in the\nprocess of being rewritten as a series of manual pages which will be available\nin the repository and online for viewing.\n\nTo read the ctio manual page simple run, from the root of the workspace:\n\nman -Mman -s 3ctype ctio\n",
+  "readmeFilename": "README",
+  "_id": "ctype@0.5.2",
+  "dist": {
+    "shasum": "f4d4f9aa7e3086e282e40d78cfa6f4e3543c3bbf"
+  },
+  "_from": "ctype@0.5.2",
+  "_resolved": "https://registry.npmjs.org/ctype/-/ctype-0.5.2.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsl.conf	(revision 487)
@@ -0,0 +1,129 @@
+#
+# Configuration File for JavaScript Lint 0.3.0
+# Developed by Matthias Miller (http://www.JavaScriptLint.com)
+#
+# This configuration file can be used to lint a collection of scripts, or to enable
+# or disable warnings for scripts that are linted via the command line.
+#
+
+### Warnings
+# Enable or disable warnings based on requirements.
+# Use "+WarningName" to display or "-WarningName" to suppress.
+#
++no_return_value              # function {0} does not always return a value
++duplicate_formal             # duplicate formal argument {0}
++equal_as_assign              # test for equality (==) mistyped as assignment (=)?{0}
++var_hides_arg                # variable {0} hides argument
++redeclared_var               # redeclaration of {0} {1}
++anon_no_return_value         # anonymous function does not always return a value
++missing_semicolon            # missing semicolon
++meaningless_block            # meaningless block; curly braces have no impact
++comma_separated_stmts        # multiple statements separated by commas (use semicolons?)
++unreachable_code             # unreachable code
++missing_break                # missing break statement
++missing_break_for_last_case  # missing break statement for last case in switch
++comparison_type_conv         # comparisons against null, 0, true, false, or an empty string allowing implicit type conversion (use === or !==)
+-inc_dec_within_stmt          # increment (++) and decrement (--) operators used as part of greater statement
++useless_void                 # use of the void type may be unnecessary (void is always undefined)
+-useless_quotes			# quotation marks are unnecessary
++multiple_plus_minus          # unknown order of operations for successive plus (e.g. x+++y) or minus (e.g. x---y) signs
++use_of_label                 # use of label
+-block_without_braces         # block statement without curly braces
++leading_decimal_point        # leading decimal point may indicate a number or an object member
++trailing_decimal_point       # trailing decimal point may indicate a number or an object member
+-octal_number                 # leading zeros make an octal number
++nested_comment               # nested comment
++misplaced_regex              # regular expressions should be preceded by a left parenthesis, assignment, colon, or comma
++ambiguous_newline            # unexpected end of line; it is ambiguous whether these lines are part of the same statement
++empty_statement              # empty statement or extra semicolon
+-missing_option_explicit      # the "option explicit" control comment is missing
++partial_option_explicit      # the "option explicit" control comment, if used, must be in the first script tag
++dup_option_explicit          # duplicate "option explicit" control comment
++useless_assign               # useless assignment
++ambiguous_nested_stmt        # block statements containing block statements should use curly braces to resolve ambiguity
++ambiguous_else_stmt          # the else statement could be matched with one of multiple if statements (use curly braces to indicate intent)
++missing_default_case         # missing default case in switch statement
++duplicate_case_in_switch     # duplicate case in switch statements
++default_not_at_end           # the default case is not at the end of the switch statement
++legacy_cc_not_understood     # couldn't understand control comment using /*@keyword@*/ syntax
++jsl_cc_not_understood        # couldn't understand control comment using /*jsl:keyword*/ syntax
++useless_comparison           # useless comparison; comparing identical expressions
++with_statement               # with statement hides undeclared variables; use temporary variable instead
++trailing_comma_in_array      # extra comma is not recommended in array initializers
++assign_to_function_call      # assignment to a function call
++parseint_missing_radix       # parseInt missing radix parameter
+-unreferenced_argument        # argument declared but never referenced: {name}
+
+### Output format
+# Customize the format of the error message.
+#    __FILE__ indicates current file path
+#    __FILENAME__ indicates current file name
+#    __LINE__ indicates current line
+#    __ERROR__ indicates error message
+#
+# Visual Studio syntax (default):
++output-format __FILE__(__LINE__): __ERROR__
+# Alternative syntax:
+#+output-format __FILE__:__LINE__: __ERROR__
+
+
+### Context
+# Show the in-line position of the error.
+# Use "+context" to display or "-context" to suppress.
+#
++context
+
+
+### Semicolons
+# By default, assignments of an anonymous function to a variable or
+# property (such as a function prototype) must be followed by a semicolon.
+#
+#+lambda_assign_requires_semicolon # deprecated setting
+
+
+### Control Comments
+# Both JavaScript Lint and the JScript interpreter confuse each other with the syntax for
+# the /*@keyword@*/ control comments and JScript conditional comments. (The latter is
+# enabled in JScript with @cc_on@). The /*jsl:keyword*/ syntax is preferred for this reason,
+# although legacy control comments are enabled by default for backward compatibility.
+#
++legacy_control_comments
+
+
+### JScript Function Extensions
+# JScript allows member functions to be defined like this:
+#     function MyObj() { /*constructor*/ }
+#     function MyObj.prototype.go() { /*member function*/ }
+#
+# It also allows events to be attached like this:
+#     function window::onload() { /*init page*/ }
+#
+# This is a Microsoft-only JavaScript extension. Enable this setting to allow them.
+#
+#-jscript_function_extensions # deprecated setting
+
+
+### Defining identifiers
+# By default, "option explicit" is enabled on a per-file basis.
+# To enable this for all files, use "+always_use_option_explicit"
+-always_use_option_explicit
+
+# Define certain identifiers of which the lint is not aware.
+# (Use this in conjunction with the "undeclared identifier" warning.)
+#
+# Common uses for webpages might be:
+#+define window
+#+define document
++define require
++define exports
++define console
++define Buffer
++define JSON
+
+### Files
+# Specify which files to lint
+# Use "+recurse" to enable recursion (disabled by default).
+# To add a set of files, use "+process FileName", "+process Folder\Path\*.js",
+# or "+process Folder\Path\*.htm".
+#
+#+process jsl-test.js
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tools/jsstyle	(revision 487)
@@ -0,0 +1,839 @@
+#!/usr/bin/env perl
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Use is subject to license terms.
+#
+# Copyright 2011 Joyent, Inc. All rights reserved.
+#
+# jsstyle - check for some common stylistic errors.
+#
+#	jsstyle is a sort of "lint" for Javascript coding style.  This tool is
+#	derived from the cstyle tool, used to check for the style used in the
+#	Solaris kernel, sometimes known as "Bill Joy Normal Form".
+#
+#	There's a lot this can't check for, like proper indentation of code
+#	blocks.  There's also a lot more this could check for.
+#
+#	A note to the non perl literate:
+#
+#		perl regular expressions are pretty much like egrep
+#		regular expressions, with the following special symbols
+#
+#		\s	any space character
+#		\S	any non-space character
+#		\w	any "word" character [a-zA-Z0-9_]
+#		\W	any non-word character
+#		\d	a digit [0-9]
+#		\D	a non-digit
+#		\b	word boundary (between \w and \W)
+#		\B	non-word boundary
+#
+
+require 5.0;
+use IO::File;
+use Getopt::Std;
+use strict;
+
+my $usage =
+"usage: jsstyle [-chvC] [-o constructs] file ...
+	-c	check continuation indentation inside functions
+	-h	perform heuristic checks that are sometimes wrong
+	-v	verbose
+	-C	don't check anything in header block comments
+	-o constructs
+		allow a comma-seperated list of optional constructs:
+		    doxygen	allow doxygen-style block comments (/** /*!)
+		    splint	allow splint-style lint comments (/*@ ... @*/)
+";
+
+my %opts;
+
+if (!getopts("cho:vC", \%opts)) {
+	print $usage;
+	exit 2;
+}
+
+my $check_continuation = $opts{'c'};
+my $heuristic = $opts{'h'};
+my $verbose = $opts{'v'};
+my $ignore_hdr_comment = $opts{'C'};
+
+my $doxygen_comments = 0;
+my $splint_comments = 0;
+
+if (defined($opts{'o'})) {
+	for my $x (split /,/, $opts{'o'}) {
+		if ($x eq "doxygen") {
+			$doxygen_comments = 1;
+		} elsif ($x eq "splint") {
+			$splint_comments = 1;
+		} else {
+			print "jsstyle: unrecognized construct \"$x\"\n";
+			print $usage;
+			exit 2;
+		}
+	}
+}
+
+my ($filename, $line, $prev);		# shared globals
+
+my $fmt;
+my $hdr_comment_start;
+
+if ($verbose) {
+	$fmt = "%s: %d: %s\n%s\n";
+} else {
+	$fmt = "%s: %d: %s\n";
+}
+
+if ($doxygen_comments) {
+	# doxygen comments look like "/*!" or "/**"; allow them.
+	$hdr_comment_start = qr/^\s*\/\*[\!\*]?$/;
+} else {
+	$hdr_comment_start = qr/^\s*\/\*$/;
+}
+
+# Note, following must be in single quotes so that \s and \w work right.
+my $lint_re = qr/\/\*(?:
+	jsl:\w+?|ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*|
+	CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|
+	FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*|
+	PROTOLIB[0-9]*|SCANFLIKE[0-9]*|JSSTYLED.*?
+    )\*\//x;
+
+my $splint_re = qr/\/\*@.*?@\*\//x;
+
+my $err_stat = 0;		# exit status
+
+if ($#ARGV >= 0) {
+	foreach my $arg (@ARGV) {
+		my $fh = new IO::File $arg, "r";
+		if (!defined($fh)) {
+			printf "%s: cannot open\n", $arg;
+		} else {
+			&jsstyle($arg, $fh);
+			close $fh;
+		}
+	}
+} else {
+	&jsstyle("<stdin>", *STDIN);
+}
+exit $err_stat;
+
+my $no_errs = 0;		# set for JSSTYLED-protected lines
+
+sub err($) {
+	my ($error) = @_;
+	unless ($no_errs) {
+		printf $fmt, $filename, $., $error, $line;
+		$err_stat = 1;
+	}
+}
+
+sub err_prefix($$) {
+	my ($prevline, $error) = @_;
+	my $out = $prevline."\n".$line;
+	unless ($no_errs) {
+		printf $fmt, $filename, $., $error, $out;
+		$err_stat = 1;
+	}
+}
+
+sub err_prev($) {
+	my ($error) = @_;
+	unless ($no_errs) {
+		printf $fmt, $filename, $. - 1, $error, $prev;
+		$err_stat = 1;
+	}
+}
+
+sub jsstyle($$) {
+
+my ($fn, $filehandle) = @_;
+$filename = $fn;			# share it globally
+
+my $in_cpp = 0;
+my $next_in_cpp = 0;
+
+my $in_comment = 0;
+my $in_header_comment = 0;
+my $comment_done = 0;
+my $in_function = 0;
+my $in_function_header = 0;
+my $in_declaration = 0;
+my $note_level = 0;
+my $nextok = 0;
+my $nocheck = 0;
+
+my $in_string = 0;
+
+my ($okmsg, $comment_prefix);
+
+$line = '';
+$prev = '';
+reset_indent();
+
+line: while (<$filehandle>) {
+	s/\r?\n$//;	# strip return and newline
+
+	# save the original line, then remove all text from within
+	# double or single quotes, we do not want to check such text.
+
+	$line = $_;
+
+	#
+	# C allows strings to be continued with a backslash at the end of
+	# the line.  We translate that into a quoted string on the previous
+	# line followed by an initial quote on the next line.
+	#
+	# (we assume that no-one will use backslash-continuation with character
+	# constants)
+	#
+	$_ = '"' . $_		if ($in_string && !$nocheck && !$in_comment);
+
+	#
+	# normal strings and characters
+	#
+	s/'([^\\']|\\.)*'/\'\'/g;
+	s/"([^\\"]|\\.)*"/\"\"/g;
+
+	#
+	# detect string continuation
+	#
+	if ($nocheck || $in_comment) {
+		$in_string = 0;
+	} else {
+		#
+		# Now that all full strings are replaced with "", we check
+		# for unfinished strings continuing onto the next line.
+		#
+		$in_string =
+		    (s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ ||
+		    s/^("")*"([^\\"]|\\.)*\\$/""/);
+	}
+
+	#
+	# figure out if we are in a cpp directive
+	#
+	$in_cpp = $next_in_cpp || /^\s*#/;	# continued or started
+	$next_in_cpp = $in_cpp && /\\$/;	# only if continued
+
+	# strip off trailing backslashes, which appear in long macros
+	s/\s*\\$//;
+
+	# an /* END JSSTYLED */ comment ends a no-check block.
+	if ($nocheck) {
+		if (/\/\* *END *JSSTYLED *\*\//) {
+			$nocheck = 0;
+		} else {
+			reset_indent();
+			next line;
+		}
+	}
+
+	# a /*JSSTYLED*/ comment indicates that the next line is ok.
+	if ($nextok) {
+		if ($okmsg) {
+			err($okmsg);
+		}
+		$nextok = 0;
+		$okmsg = 0;
+		if (/\/\* *JSSTYLED.*\*\//) {
+			/^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
+			$okmsg = $1;
+			$nextok = 1;
+		}
+		$no_errs = 1;
+	} elsif ($no_errs) {
+		$no_errs = 0;
+	}
+
+	# check length of line.
+	# first, a quick check to see if there is any chance of being too long.
+	if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) {
+		# yes, there is a chance.
+		# replace tabs with spaces and check again.
+		my $eline = $line;
+		1 while $eline =~
+		    s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
+		if (length($eline) > 80) {
+			err("line > 80 characters");
+		}
+	}
+
+	# ignore NOTE(...) annotations (assumes NOTE is on lines by itself).
+	if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE
+		s/[^()]//g;			  # eliminate all non-parens
+		$note_level += s/\(//g - length;  # update paren nest level
+		next;
+	}
+
+	# a /* BEGIN JSSTYLED */ comment starts a no-check block.
+	if (/\/\* *BEGIN *JSSTYLED *\*\//) {
+		$nocheck = 1;
+	}
+
+	# a /*JSSTYLED*/ comment indicates that the next line is ok.
+	if (/\/\* *JSSTYLED.*\*\//) {
+		/^.*\/\* *JSSTYLED *(.*) *\*\/.*$/;
+		$okmsg = $1;
+		$nextok = 1;
+	}
+	if (/\/\/ *JSSTYLED/) {
+		/^.*\/\/ *JSSTYLED *(.*)$/;
+		$okmsg = $1;
+		$nextok = 1;
+	}
+
+	# universal checks; apply to everything
+	if (/\t +\t/) {
+		err("spaces between tabs");
+	}
+	if (/ \t+ /) {
+		err("tabs between spaces");
+	}
+	if (/\s$/) {
+		err("space or tab at end of line");
+	}
+	if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) {
+		err("comment preceded by non-blank");
+	}
+
+	# is this the beginning or ending of a function?
+	# (not if "struct foo\n{\n")
+	if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) {
+		$in_function = 1;
+		$in_declaration = 1;
+		$in_function_header = 0;
+		$prev = $line;
+		next line;
+	}
+	if (/^}\s*(\/\*.*\*\/\s*)*$/) {
+		if ($prev =~ /^\s*return\s*;/) {
+			err_prev("unneeded return at end of function");
+		}
+		$in_function = 0;
+		reset_indent();		# we don't check between functions
+		$prev = $line;
+		next line;
+	}
+	if (/^\w*\($/) {
+		$in_function_header = 1;
+	}
+
+	# a blank line terminates the declarations within a function.
+	# XXX - but still a problem in sub-blocks.
+	if ($in_declaration && /^$/) {
+		$in_declaration = 0;
+	}
+
+	if ($comment_done) {
+		$in_comment = 0;
+		$in_header_comment = 0;
+		$comment_done = 0;
+	}
+	# does this looks like the start of a block comment?
+	if (/$hdr_comment_start/) {
+		if (!/^\t*\/\*/) {
+			err("block comment not indented by tabs");
+		}
+		$in_comment = 1;
+		/^(\s*)\//;
+		$comment_prefix = $1;
+		if ($comment_prefix eq "") {
+			$in_header_comment = 1;
+		}
+		$prev = $line;
+		next line;
+	}
+	# are we still in the block comment?
+	if ($in_comment) {
+		if (/^$comment_prefix \*\/$/) {
+			$comment_done = 1;
+		} elsif (/\*\//) {
+			$comment_done = 1;
+			err("improper block comment close")
+			    unless ($ignore_hdr_comment && $in_header_comment);
+		} elsif (!/^$comment_prefix \*[ \t]/ &&
+		    !/^$comment_prefix \*$/) {
+			err("improper block comment")
+			    unless ($ignore_hdr_comment && $in_header_comment);
+		}
+	}
+
+	if ($in_header_comment && $ignore_hdr_comment) {
+		$prev = $line;
+		next line;
+	}
+
+	# check for errors that might occur in comments and in code.
+
+	# allow spaces to be used to draw pictures in header comments.
+	#if (/[^ ]     / && !/".*     .*"/ && !$in_header_comment) {
+	#	err("spaces instead of tabs");
+	#}
+	#if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ &&
+	#    (!/^    \w/ || $in_function != 0)) {
+	#	err("indent by spaces instead of tabs");
+	#}
+	if (/^ {2,}/ && !/^    [^ ]/) {
+		err("indent by spaces instead of tabs");
+	}
+	if (/^\t+ [^ \t\*]/ || /^\t+  \S/ || /^\t+   \S/) {
+		err("continuation line not indented by 4 spaces");
+	}
+
+	if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) {
+		err("improper first line of block comment");
+	}
+
+	if ($in_comment) {	# still in comment, don't do further checks
+		$prev = $line;
+		next line;
+	}
+
+	if ((/[^(]\/\*\S/ || /^\/\*\S/) &&
+	    !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
+		err("missing blank after open comment");
+	}
+	if (/\S\*\/[^)]|\S\*\/$/ &&
+	    !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
+		err("missing blank before close comment");
+	}
+	if (/\/\/\S/) {		# C++ comments
+		err("missing blank after start comment");
+	}
+	# check for unterminated single line comments, but allow them when
+	# they are used to comment out the argument list of a function
+	# declaration.
+	if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) {
+		err("unterminated single line comment");
+	}
+
+	if (/^(#else|#endif|#include)(.*)$/) {
+		$prev = $line;
+		next line;
+	}
+
+	#
+	# delete any comments and check everything else.  Note that
+	# ".*?" is a non-greedy match, so that we don't get confused by
+	# multiple comments on the same line.
+	#
+	s/\/\*.*?\*\///g;
+	s/\/\/.*$//;		# C++ comments
+
+	# delete any trailing whitespace; we have already checked for that.
+	s/\s*$//;
+
+	# following checks do not apply to text in comments.
+	if (/"/) {
+		err("literal string using double-quote instead of single");
+	}
+
+	if (/[^=!<>\s][!<>=]=/ || /[^<>!=][!<>=]==?[^\s,=]/ ||
+	    (/[^->]>[^,=>\s]/ && !/[^->]>$/) ||
+	    (/[^<]<[^,=<\s]/ && !/[^<]<$/) ||
+	    /[^<\s]<[^<]/ || /[^->\s]>[^>]/) {
+		err("missing space around relational operator");
+	}
+	if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ ||
+	    (/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) ||
+	    (/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) {
+		# XXX - should only check this for C++ code
+		# XXX - there are probably other forms that should be allowed
+		if (!/\soperator=/) {
+			err("missing space around assignment operator");
+		}
+	}
+	if (/[,;]\S/ && !/\bfor \(;;\)/) {
+		err("comma or semicolon followed by non-blank");
+	}
+	# allow "for" statements to have empty "while" clauses
+	if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) {
+		err("comma or semicolon preceded by blank");
+	}
+	if (/^\s*(&&|\|\|)/) {
+		err("improper boolean continuation");
+	}
+	if (/\S   *(&&|\|\|)/ || /(&&|\|\|)   *\S/) {
+		err("more than one space around boolean operator");
+	}
+	if (/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\(/) {
+		err("missing space between keyword and paren");
+	}
+	if (/(\b(catch|for|if|with|while|switch|return)\b.*){2,}/) {
+		# multiple "case" and "sizeof" allowed
+		err("more than one keyword on line");
+	}
+	if (/\b(delete|typeof|instanceOf|with|throw|catch|new|function|in|for|if|while|switch|return|case)\s\s+\(/ &&
+	    !/^#if\s+\(/) {
+		err("extra space between keyword and paren");
+	}
+	# try to detect "func (x)" but not "if (x)" or
+	# "#define foo (x)" or "int (*func)();"
+	if (/\w\s\(/) {
+		my $s = $_;
+		# strip off all keywords on the line
+		s/\b(delete|typeof|instanceOf|throw|with|catch|new|function|in|for|if|while|switch|return|case)\s\(/XXX(/g;
+		s/#elif\s\(/XXX(/g;
+		s/^#define\s+\w+\s+\(/XXX(/;
+		# do not match things like "void (*f)();"
+		# or "typedef void (func_t)();"
+		s/\w\s\(+\*/XXX(*/g;
+		s/\b(void)\s+\(+/XXX(/og;
+		if (/\w\s\(/) {
+			err("extra space between function name and left paren");
+		}
+		$_ = $s;
+	}
+
+	if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) {
+		err("unparenthesized return expression");
+	}
+	if (/\btypeof\b/ && !/\btypeof\s*\(.*\)/) {
+		err("unparenthesized typeof expression");
+	}
+	if (/\(\s/) {
+		err("whitespace after left paren");
+	}
+	# allow "for" statements to have empty "continue" clauses
+	if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/) {
+		err("whitespace before right paren");
+	}
+	if (/^\s*\(void\)[^ ]/) {
+		err("missing space after (void) cast");
+	}
+	if (/\S{/ && !/({|\(){/) {
+		err("missing space before left brace");
+	}
+	if ($in_function && /^\s+{/ &&
+	    ($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) {
+		err("left brace starting a line");
+	}
+	if (/}(else|while)/) {
+		err("missing space after right brace");
+	}
+	if (/}\s\s+(else|while)/) {
+		err("extra space after right brace");
+	}
+	if (/^\s+#/) {
+		err("preprocessor statement not in column 1");
+	}
+	if (/^#\s/) {
+		err("blank after preprocessor #");
+	}
+
+	#
+	# We completely ignore, for purposes of indentation:
+	#  * lines outside of functions
+	#  * preprocessor lines
+	#
+	if ($check_continuation && $in_function && !$in_cpp) {
+		process_indent($_);
+	}
+
+	if ($heuristic) {
+		# cannot check this everywhere due to "struct {\n...\n} foo;"
+		if ($in_function && !$in_declaration &&
+		    /}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|)*$/ &&
+		    !/} (else|while)/ && !/}}/) {
+			err("possible bad text following right brace");
+		}
+		# cannot check this because sub-blocks in
+		# the middle of code are ok
+		if ($in_function && /^\s+{/) {
+			err("possible left brace starting a line");
+		}
+	}
+	if (/^\s*else\W/) {
+		if ($prev =~ /^\s*}$/) {
+			err_prefix($prev,
+			    "else and right brace should be on same line");
+		}
+	}
+	$prev = $line;
+}
+
+if ($prev eq "") {
+	err("last line in file is blank");
+}
+
+}
+
+#
+# Continuation-line checking
+#
+# The rest of this file contains the code for the continuation checking
+# engine.  It's a pretty simple state machine which tracks the expression
+# depth (unmatched '('s and '['s).
+#
+# Keep in mind that the argument to process_indent() has already been heavily
+# processed; all comments have been replaced by control-A, and the contents of
+# strings and character constants have been elided.
+#
+
+my $cont_in;		# currently inside of a continuation
+my $cont_off;		# skipping an initializer or definition
+my $cont_noerr;		# suppress cascading errors
+my $cont_start;		# the line being continued
+my $cont_base;		# the base indentation
+my $cont_first;		# this is the first line of a statement
+my $cont_multiseg;	# this continuation has multiple segments
+
+my $cont_special;	# this is a C statement (if, for, etc.)
+my $cont_macro;		# this is a macro
+my $cont_case;		# this is a multi-line case
+
+my @cont_paren;		# the stack of unmatched ( and [s we've seen
+
+sub
+reset_indent()
+{
+	$cont_in = 0;
+	$cont_off = 0;
+}
+
+sub
+delabel($)
+{
+	#
+	# replace labels with tabs.  Note that there may be multiple
+	# labels on a line.
+	#
+	local $_ = $_[0];
+
+	while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) {
+		my ($pre_tabs, $label, $rest) = ($1, $2, $3);
+		$_ = $pre_tabs;
+		while ($label =~ s/^([^\t]*)(\t+)//) {
+			$_ .= "\t" x (length($2) + length($1) / 8);
+		}
+		$_ .= ("\t" x (length($label) / 8)).$rest;
+	}
+
+	return ($_);
+}
+
+sub
+process_indent($)
+{
+	require strict;
+	local $_ = $_[0];			# preserve the global $_
+
+	s///g;	# No comments
+	s/\s+$//;	# Strip trailing whitespace
+
+	return			if (/^$/);	# skip empty lines
+
+	# regexps used below; keywords taking (), macros, and continued cases
+	my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b';
+	my $macro = '[A-Z_][A-Z_0-9]*\(';
+	my $case = 'case\b[^:]*$';
+
+	# skip over enumerations, array definitions, initializers, etc.
+	if ($cont_off <= 0 && !/^\s*$special/ &&
+	    (/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*)){/ ||
+	    (/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) {
+		$cont_in = 0;
+		$cont_off = tr/{/{/ - tr/}/}/;
+		return;
+	}
+	if ($cont_off) {
+		$cont_off += tr/{/{/ - tr/}/}/;
+		return;
+	}
+
+	if (!$cont_in) {
+		$cont_start = $line;
+
+		if (/^\t* /) {
+			err("non-continuation indented 4 spaces");
+			$cont_noerr = 1;		# stop reporting
+		}
+		$_ = delabel($_);	# replace labels with tabs
+
+		# check if the statement is complete
+		return		if (/^\s*\}?$/);
+		return		if (/^\s*\}?\s*else\s*\{?$/);
+		return		if (/^\s*do\s*\{?$/);
+		return		if (/{$/);
+		return		if (/}[,;]?$/);
+
+		# Allow macros on their own lines
+		return		if (/^\s*[A-Z_][A-Z_0-9]*$/);
+
+		# cases we don't deal with, generally non-kosher
+		if (/{/) {
+			err("stuff after {");
+			return;
+		}
+
+		# Get the base line, and set up the state machine
+		/^(\t*)/;
+		$cont_base = $1;
+		$cont_in = 1;
+		@cont_paren = ();
+		$cont_first = 1;
+		$cont_multiseg = 0;
+
+		# certain things need special processing
+		$cont_special = /^\s*$special/? 1 : 0;
+		$cont_macro = /^\s*$macro/? 1 : 0;
+		$cont_case = /^\s*$case/? 1 : 0;
+	} else {
+		$cont_first = 0;
+
+		# Strings may be pulled back to an earlier (half-)tabstop
+		unless ($cont_noerr || /^$cont_base    / ||
+		    (/^\t*(?:    )?(?:gettext\()?\"/ && !/^$cont_base\t/)) {
+			err_prefix($cont_start,
+			    "continuation should be indented 4 spaces");
+		}
+	}
+
+	my $rest = $_;			# keeps the remainder of the line
+
+	#
+	# The split matches 0 characters, so that each 'special' character
+	# is processed separately.  Parens and brackets are pushed and
+	# popped off the @cont_paren stack.  For normal processing, we wait
+	# until a ; or { terminates the statement.  "special" processing
+	# (if/for/while/switch) is allowed to stop when the stack empties,
+	# as is macro processing.  Case statements are terminated with a :
+	# and an empty paren stack.
+	#
+	foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) {
+		next		if (length($_) == 0);
+
+		# rest contains the remainder of the line
+		my $rxp = "[^\Q$_\E]*\Q$_\E";
+		$rest =~ s/^$rxp//;
+
+		if (/\(/ || /\[/) {
+			push @cont_paren, $_;
+		} elsif (/\)/ || /\]/) {
+			my $cur = $_;
+			tr/\)\]/\(\[/;
+
+			my $old = (pop @cont_paren);
+			if (!defined($old)) {
+				err("unexpected '$cur'");
+				$cont_in = 0;
+				last;
+			} elsif ($old ne $_) {
+				err("'$cur' mismatched with '$old'");
+				$cont_in = 0;
+				last;
+			}
+
+			#
+			# If the stack is now empty, do special processing
+			# for if/for/while/switch and macro statements.
+			#
+			next		if (@cont_paren != 0);
+			if ($cont_special) {
+				if ($rest =~ /^\s*{?$/) {
+					$cont_in = 0;
+					last;
+				}
+				if ($rest =~ /^\s*;$/) {
+					err("empty if/for/while body ".
+					    "not on its own line");
+					$cont_in = 0;
+					last;
+				}
+				if (!$cont_first && $cont_multiseg == 1) {
+					err_prefix($cont_start,
+					    "multiple statements continued ".
+					    "over multiple lines");
+					$cont_multiseg = 2;
+				} elsif ($cont_multiseg == 0) {
+					$cont_multiseg = 1;
+				}
+				# We've finished this section, start
+				# processing the next.
+				goto section_ended;
+			}
+			if ($cont_macro) {
+				if ($rest =~ /^$/) {
+					$cont_in = 0;
+					last;
+				}
+			}
+		} elsif (/\;/) {
+			if ($cont_case) {
+				err("unexpected ;");
+			} elsif (!$cont_special) {
+				err("unexpected ;")	if (@cont_paren != 0);
+				if (!$cont_first && $cont_multiseg == 1) {
+					err_prefix($cont_start,
+					    "multiple statements continued ".
+					    "over multiple lines");
+					$cont_multiseg = 2;
+				} elsif ($cont_multiseg == 0) {
+					$cont_multiseg = 1;
+				}
+				if ($rest =~ /^$/) {
+					$cont_in = 0;
+					last;
+				}
+				if ($rest =~ /^\s*special/) {
+					err("if/for/while/switch not started ".
+					    "on its own line");
+				}
+				goto section_ended;
+			}
+		} elsif (/\{/) {
+			err("{ while in parens/brackets") if (@cont_paren != 0);
+			err("stuff after {")		if ($rest =~ /[^\s}]/);
+			$cont_in = 0;
+			last;
+		} elsif (/\}/) {
+			err("} while in parens/brackets") if (@cont_paren != 0);
+			if (!$cont_special && $rest !~ /^\s*(while|else)\b/) {
+				if ($rest =~ /^$/) {
+					err("unexpected }");
+				} else {
+					err("stuff after }");
+				}
+				$cont_in = 0;
+				last;
+			}
+		} elsif (/\:/ && $cont_case && @cont_paren == 0) {
+			err("stuff after multi-line case") if ($rest !~ /$^/);
+			$cont_in = 0;
+			last;
+		}
+		next;
+section_ended:
+		# End of a statement or if/while/for loop.  Reset
+		# cont_special and cont_macro based on the rest of the
+		# line.
+		$cont_special = ($rest =~ /^\s*$special/)? 1 : 0;
+		$cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0;
+		$cont_case = 0;
+		next;
+	}
+	$cont_noerr = 0			if (!$cont_in);
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/float.json	(revision 487)
@@ -0,0 +1,13 @@
+{ "metadata":
+	{
+		"ctf2json_version": "1.0",
+		"created_at": 1316563626,
+		"derived_from": "/lib/libc.so",
+		"ctf_version": 2,
+		"requested_types": [ "float" ]
+	},
+"data":
+	[
+		{ "name": "float", "float": { "length": 4 } }
+	]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/int.json	(revision 487)
@@ -0,0 +1,13 @@
+{ "metadata":
+	{
+		"ctf2json_version": "1.0",
+		"created_at": 1316563631,
+		"derived_from": "/lib/libc.so",
+		"ctf_version": 2,
+		"requested_types": [ "int" ]
+	},
+"data":
+	[
+		{ "name": "int", "integer": { "length": 4, "signed": true } }
+	]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/psinfo.json	(revision 487)
@@ -0,0 +1,104 @@
+{ "metadata":
+	{
+		"ctf2json_version": "1.0",
+		"created_at": 1316563573,
+		"derived_from": "/lib/libc.so",
+		"ctf_version": 2,
+		"requested_types": [ "psinfo_t" ]
+	},
+"data":
+	[
+		{ "name": "int", "integer": { "length": 4, "signed": true } },
+		{ "name": "char", "integer": { "length": 1, "signed": true } },
+		{ "name": "unsigned short", "integer": { "length": 2, "signed": false } },
+		{ "name": "long", "integer": { "length": 4, "signed": true } },
+		{ "name": "unsigned", "integer": { "length": 4, "signed": false } },
+		{ "name": "size_t", "typedef": "unsigned" },
+		{ "name": "unsigned long", "integer": { "length": 4, "signed": false } },
+		{ "name": "time_t", "typedef": "long" },
+		{ "name": "struct timespec", "struct": [
+			{ "name": "tv_sec", "type": "time_t" },
+			{ "name": "tv_nsec", "type": "long" }
+		] },
+		{ "name": "zoneid_t", "typedef": "long" },
+		{ "name": "taskid_t", "typedef": "long" },
+		{ "name": "dev_t", "typedef": "unsigned long" },
+		{ "name": "uid_t", "typedef": "unsigned" },
+		{ "name": "gid_t", "typedef": "unsigned" },
+		{ "name": "timestruc_t", "typedef": "struct timespec" },
+		{ "name": "short", "integer": { "length": 2, "signed": true } },
+		{ "name": "projid_t", "typedef": "long" },
+		{ "name": "ushort_t", "typedef": "unsigned short" },
+		{ "name": "poolid_t", "typedef": "long" },
+		{ "name": "uintptr_t", "typedef": "unsigned" },
+		{ "name": "id_t", "typedef": "long" },
+		{ "name": "pid_t", "typedef": "long" },
+		{ "name": "processorid_t", "typedef": "int" },
+		{ "name": "psetid_t", "typedef": "int" },
+		{ "name": "struct lwpsinfo", "struct": [
+			{ "name": "pr_flag", "type": "int" },
+			{ "name": "pr_lwpid", "type": "id_t" },
+			{ "name": "pr_addr", "type": "uintptr_t" },
+			{ "name": "pr_wchan", "type": "uintptr_t" },
+			{ "name": "pr_stype", "type": "char" },
+			{ "name": "pr_state", "type": "char" },
+			{ "name": "pr_sname", "type": "char" },
+			{ "name": "pr_nice", "type": "char" },
+			{ "name": "pr_syscall", "type": "short" },
+			{ "name": "pr_oldpri", "type": "char" },
+			{ "name": "pr_cpu", "type": "char" },
+			{ "name": "pr_pri", "type": "int" },
+			{ "name": "pr_pctcpu", "type": "ushort_t" },
+			{ "name": "pr_pad", "type": "ushort_t" },
+			{ "name": "pr_start", "type": "timestruc_t" },
+			{ "name": "pr_time", "type": "timestruc_t" },
+			{ "name": "pr_clname", "type": "char [8]" },
+			{ "name": "pr_name", "type": "char [16]" },
+			{ "name": "pr_onpro", "type": "processorid_t" },
+			{ "name": "pr_bindpro", "type": "processorid_t" },
+			{ "name": "pr_bindpset", "type": "psetid_t" },
+			{ "name": "pr_lgrp", "type": "int" },
+			{ "name": "pr_filler", "type": "int [4]" }
+		] },
+		{ "name": "lwpsinfo_t", "typedef": "struct lwpsinfo" },
+		{ "name": "struct psinfo", "struct": [
+			{ "name": "pr_flag", "type": "int" },
+			{ "name": "pr_nlwp", "type": "int" },
+			{ "name": "pr_pid", "type": "pid_t" },
+			{ "name": "pr_ppid", "type": "pid_t" },
+			{ "name": "pr_pgid", "type": "pid_t" },
+			{ "name": "pr_sid", "type": "pid_t" },
+			{ "name": "pr_uid", "type": "uid_t" },
+			{ "name": "pr_euid", "type": "uid_t" },
+			{ "name": "pr_gid", "type": "gid_t" },
+			{ "name": "pr_egid", "type": "gid_t" },
+			{ "name": "pr_addr", "type": "uintptr_t" },
+			{ "name": "pr_size", "type": "size_t" },
+			{ "name": "pr_rssize", "type": "size_t" },
+			{ "name": "pr_pad1", "type": "size_t" },
+			{ "name": "pr_ttydev", "type": "dev_t" },
+			{ "name": "pr_pctcpu", "type": "ushort_t" },
+			{ "name": "pr_pctmem", "type": "ushort_t" },
+			{ "name": "pr_start", "type": "timestruc_t" },
+			{ "name": "pr_time", "type": "timestruc_t" },
+			{ "name": "pr_ctime", "type": "timestruc_t" },
+			{ "name": "pr_fname", "type": "char [16]" },
+			{ "name": "pr_psargs", "type": "char [80]" },
+			{ "name": "pr_wstat", "type": "int" },
+			{ "name": "pr_argc", "type": "int" },
+			{ "name": "pr_argv", "type": "uintptr_t" },
+			{ "name": "pr_envp", "type": "uintptr_t" },
+			{ "name": "pr_dmodel", "type": "char" },
+			{ "name": "pr_pad2", "type": "char [3]" },
+			{ "name": "pr_taskid", "type": "taskid_t" },
+			{ "name": "pr_projid", "type": "projid_t" },
+			{ "name": "pr_nzomb", "type": "int" },
+			{ "name": "pr_poolid", "type": "poolid_t" },
+			{ "name": "pr_zoneid", "type": "zoneid_t" },
+			{ "name": "pr_contract", "type": "id_t" },
+			{ "name": "pr_filler", "type": "int [1]" },
+			{ "name": "pr_lwp", "type": "lwpsinfo_t" }
+		] },
+		{ "name": "psinfo_t", "typedef": "struct psinfo" }
+	]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/struct.json	(revision 487)
@@ -0,0 +1,19 @@
+{ "metadata":
+	{
+		"ctf2json_version": "1.0",
+		"created_at": 1316563648,
+		"derived_from": "/lib/libc.so",
+		"ctf_version": 2,
+		"requested_types": [ "timestruc_t" ]
+	},
+"data":
+	[
+		{ "name": "long", "integer": { "length": 4, "signed": true } },
+		{ "name": "time_t", "typedef": "long" },
+		{ "name": "struct timespec", "struct": [
+			{ "name": "tv_sec", "type": "time_t" },
+			{ "name": "tv_nsec", "type": "long" }
+		] },
+		{ "name": "timestruc_t", "typedef": "struct timespec" }
+	]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.fail.js	(revision 487)
@@ -0,0 +1,39 @@
+/*
+ * Test several conditions that should always cause us to throw.
+ */
+var mod_assert = require('assert');
+var mod_ctype = require('../../ctype.js');
+
+var cases = [
+{ json: { }, msg: 'bad JSON - no metadata or data' },
+{ json: { metadata: {} }, msg: 'bad JSON - bad metadata section' },
+{ json: { metadata: { 'JSON version': [] } },
+    msg: 'bad JSON - bad JSON version' },
+{ json: { metadata: { 'JSON version': 2 } },
+    msg: 'bad JSON - bad JSON version' },
+{ json: { metadata: { 'JSON version': '100.20' } },
+    msg: 'bad JSON - bad JSON version' },
+{ json: { metadata: { 'JSON version': '1.0' } },
+    msg: 'missing data section' },
+{ json: { metadata: { 'JSON version': '1.0' }, data: 1 },
+    msg: 'invalid data section' },
+{ json: { metadata: { 'JSON version': '1.0' }, data: 1.1 },
+    msg: 'invalid data section' },
+{ json: { metadata: { 'JSON version': '1.0' }, data: '1.1' },
+    msg: 'invalid data section' },
+{ json: { metadata: { 'JSON version': '1.0' }, data: {} },
+    msg: 'invalid data section' }
+];
+
+function test()
+{
+	var ii;
+
+	for (ii = 0; ii < cases.length; ii++) {
+		mod_assert.throws(function () {
+		    mod_ctype.parseCTF(cases[ii].json);
+		}, Error, cases[ii].msg);
+	}
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.float.js	(revision 487)
@@ -0,0 +1,14 @@
+var mod_fs = require('fs');
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var data, parser;
+
+	data = JSON.parse(mod_fs.readFileSync('./float.json').toString());
+	parser = mod_ctype.parseCTF(data, { endian: 'big' });
+	mod_assert.deepEqual(parser.lstypes(), {});
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.int.js	(revision 487)
@@ -0,0 +1,14 @@
+var mod_fs = require('fs');
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var data, parser;
+
+	data = JSON.parse(mod_fs.readFileSync('./int.json').toString());
+	parser = mod_ctype.parseCTF(data, { endian: 'big' });
+	mod_assert.deepEqual(parser.lstypes(), { 'int': 'int32_t' });
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.psinfo.js	(revision 487)
@@ -0,0 +1,17 @@
+var mod_fs = require('fs');
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+/*
+ * This is too unwieldly to actually write out. Just make sure we can parse it
+ * without errrors.
+ */
+function test()
+{
+	var data;
+
+	data = JSON.parse(mod_fs.readFileSync('./psinfo.json').toString());
+	mod_ctype.parseCTF(data, { endian: 'big' });
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.struct.js	(revision 487)
@@ -0,0 +1,18 @@
+var mod_fs = require('fs');
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var data, parser;
+
+	data = JSON.parse(mod_fs.readFileSync('./struct.json').toString());
+	parser = mod_ctype.parseCTF(data, { endian: 'big' });
+	mod_assert.deepEqual(parser.lstypes(), { 'long': 'int32_t',
+	    'time_t': 'long',
+	    'timestruc_t': 'struct timespec',
+	    'struct timespec': [ { 'tv_sec': { 'type': 'time_t' } },
+	        { 'tv_nsec': { 'type': 'long' } } ] });
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/tst.typedef.js	(revision 487)
@@ -0,0 +1,15 @@
+var mod_fs = require('fs');
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var data, parser;
+
+	data = JSON.parse(mod_fs.readFileSync('./typedef.json').toString());
+	parser = mod_ctype.parseCTF(data, { endian: 'big' });
+	mod_assert.deepEqual(parser.lstypes(), { 'bar_t': 'int',
+	    'int': 'int32_t' });
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctf/typedef.json	(revision 487)
@@ -0,0 +1,14 @@
+{ "metadata":
+	{
+		"ctf2json_version": "1.0",
+		"created_at": 1316302348,
+		"derived_from": "/lib/libc.so",
+		"ctf_version": 2,
+		"requested_types": [ "bar_t" ]
+	},
+"data":
+	[
+		{ "name": "int", "integer": { "length": 4, "signed": true } },
+		{ "name": "bar_t", "typedef": "int" }
+	]
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.rfloat.js	(revision 487)
@@ -0,0 +1,767 @@
+/*
+ * Battery of tests to break our floating point implementation. Oh ho ho.
+ *
+ * There are a few useful ways to generate the expected output. The first is
+ * just write a C program and write raw bytes out and inspect with xxd. Remember
+ * to consider whether or not you're on a big endian or little endian machine.
+ * Another useful site I found to help with some of this was:
+ *
+ * http://babbage.cs.qc.edu/IEEE-754/
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+function testfloat()
+{
+	var buffer = new Buffer(4);
+	/* Start off with some of the easy ones: +zero */
+	buffer[0] = 0;
+	buffer[1] = 0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+
+	ASSERT.equal(0, mod_ctype.rfloat(buffer, 'big', 0));
+	ASSERT.equal(0, mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* Test -0 */
+	buffer[0] = 0x80;
+	ASSERT.equal(0, mod_ctype.rfloat(buffer, 'big', 0));
+	buffer[3] = buffer[0];
+	buffer[0] = 0;
+	ASSERT.equal(0, mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* Catch +infin */
+	buffer[0] = 0x7f;
+	buffer[1] = 0x80;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	ASSERT.equal(Number.POSITIVE_INFINITY,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+	buffer[3] = 0x7f;
+	buffer[2] = 0x80;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(Number.POSITIVE_INFINITY,
+	    mod_ctype.rfloat(buffer, 'litle', 0));
+
+	/* Catch -infin */
+	buffer[0] = 0xff;
+	buffer[1] = 0x80;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	ASSERT.equal(Number.NEGATIVE_INFINITY,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+	buffer[3] = 0xff;
+	buffer[2] = 0x80;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(Number.NEGATIVE_INFINITY,
+	    mod_ctype.rfloat(buffer, 'litle', 0));
+
+	/* Catch NaN */
+
+	buffer[0] = 0x7f;
+	buffer[1] = 0x80;
+	buffer[2] = 0x00;
+	buffer[3] = 0x23;
+	ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'big', 0)));
+	buffer[3] = 0x7f;
+	buffer[2] = 0x80;
+	buffer[1] = 0x00;
+	buffer[0] = 0x23;
+	ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'little', 0)));
+
+	/* Catch -infin */
+	buffer[0] = 0xff;
+	buffer[1] = 0x80;
+	buffer[2] = 0x00;
+	buffer[3] = 0x23;
+	ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'big', 0)));
+	buffer[3] = 0xff;
+	buffer[2] = 0x80;
+	buffer[1] = 0x00;
+	buffer[0] = 0x23;
+	ASSERT.ok(isNaN(mod_ctype.rfloat(buffer, 'little', 0)));
+
+	/* On to some basic tests */
+	/* 1.125 */
+	buffer[0] = 0x3f;
+	buffer[1] = 0x90;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	ASSERT.equal(1.125, mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x3f;
+	buffer[2] = 0x90;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(1.125, mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* ff34a2b0 -2.4010576103645774e+38 */
+	buffer[0] = 0xff;
+	buffer[1] = 0x34;
+	buffer[2] = 0xa2;
+	buffer[3] = 0xb0;
+	ASSERT.equal(-2.4010576103645774e+38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0xff;
+	buffer[2] = 0x34;
+	buffer[1] = 0xa2;
+	buffer[0] = 0xb0;
+	ASSERT.equal(-2.4010576103645774e+38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* Denormalized tests */
+
+	/* 0003f89a +/- 3.6468792534053364e-40 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x03;
+	buffer[2] = 0xf8;
+	buffer[3] = 0x9a;
+	ASSERT.equal(3.6468792534053364e-40,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x00;
+	buffer[2] = 0x03;
+	buffer[1] = 0xf8;
+	buffer[0] = 0x9a;
+	ASSERT.equal(3.6468792534053364e-40,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x03;
+	buffer[2] = 0xf8;
+	buffer[3] = 0x9a;
+	ASSERT.equal(-3.6468792534053364e-40,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x80;
+	buffer[2] = 0x03;
+	buffer[1] = 0xf8;
+	buffer[0] = 0x9a;
+	ASSERT.equal(-3.6468792534053364e-40,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+
+	/* Maximum and minimum normalized and denormalized values */
+
+	/* Largest normalized number +/- 3.4028234663852886e+38 */
+
+	buffer[0] = 0x7f;
+	buffer[1] = 0x7f;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	ASSERT.equal(3.4028234663852886e+38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x7f;
+	buffer[2] = 0x7f;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(3.4028234663852886e+38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	buffer[0] = 0xff;
+	buffer[1] = 0x7f;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	ASSERT.equal(-3.4028234663852886e+38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0xff;
+	buffer[2] = 0x7f;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(-3.4028234663852886e+38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* Smallest normalied number +/- 1.1754943508222875e-38 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x80;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	ASSERT.equal(1.1754943508222875e-38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x00;
+	buffer[2] = 0x80;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(1.1754943508222875e-38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x80;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	ASSERT.equal(-1.1754943508222875e-38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x80;
+	buffer[2] = 0x80;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(-1.1754943508222875e-38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+
+	/* Smallest denormalized number 1.401298464324817e-45 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x00;
+	buffer[2] = 0x00;
+	buffer[3] = 0x01;
+	ASSERT.equal(1.401298464324817e-45,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x00;
+	buffer[2] = 0x00;
+	buffer[1] = 0x00;
+	buffer[0] = 0x01;
+	ASSERT.equal(1.401298464324817e-45,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x00;
+	buffer[2] = 0x00;
+	buffer[3] = 0x01;
+	ASSERT.equal(-1.401298464324817e-45,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x80;
+	buffer[2] = 0x00;
+	buffer[1] = 0x00;
+	buffer[0] = 0x01;
+	ASSERT.equal(-1.401298464324817e-45,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* Largest denormalized value +/- 1.1754942106924411e-38 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x7f;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	ASSERT.equal(1.1754942106924411e-38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x00;
+	buffer[2] = 0x7f;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(1.1754942106924411e-38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x7f;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	ASSERT.equal(-1.1754942106924411e-38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+
+	buffer[3] = 0x80;
+	buffer[2] = 0x7f;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(-1.1754942106924411e-38,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+
+	/* Do some quick offset testing */
+	buffer = new Buffer(6);
+	buffer[0] = 0x7f;
+	buffer[1] = 0x4e;
+	buffer[2] = 0x8a;
+	buffer[3] = 0x79;
+	buffer[4] = 0xcd;
+	buffer[5] = 0x3f;
+
+	ASSERT.equal(2.745399582697325e+38,
+	    mod_ctype.rfloat(buffer, 'big', 0));
+	ASSERT.equal(1161619072,
+	    mod_ctype.rfloat(buffer, 'big', 1));
+	ASSERT.equal(-1.2027516403607578e-32,
+	    mod_ctype.rfloat(buffer, 'big', 2));
+
+	ASSERT.equal(8.97661320504413e+34,
+	    mod_ctype.rfloat(buffer, 'little', 0));
+	ASSERT.equal(-261661920,
+	    mod_ctype.rfloat(buffer, 'little', 1));
+	ASSERT.equal(1.605271577835083,
+	    mod_ctype.rfloat(buffer, 'little', 2));
+
+}
+
+function testdouble()
+{
+	var buffer = new Buffer(10);
+
+	/* Check 0 */
+	buffer[0] = 0;
+	buffer[1] = 0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 0;
+	ASSERT.equal(0,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+	ASSERT.equal(0,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 0;
+	ASSERT.equal(0,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+	buffer[7] = 0x80;
+	buffer[6] = 0;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 0;
+	ASSERT.equal(0,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Check NaN */
+	buffer[0] = 0x7f;
+	buffer[1] = 0xf0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 23;
+	ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'big', 0)));
+
+	buffer[7] = 0x7f;
+	buffer[6] = 0xf0;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 23;
+	ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'little', 0)));
+
+	buffer[0] = 0xff;
+	buffer[1] = 0xf0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 23;
+	ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'big', 0)));
+
+	buffer[7] = 0xff;
+	buffer[6] = 0xf0;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 23;
+	ASSERT.ok(isNaN(mod_ctype.rdouble(buffer, 'little', 0)));
+
+	/* pos inf */
+	buffer[0] = 0x7f;
+	buffer[1] = 0xf0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 0;
+	ASSERT.equal(Number.POSITIVE_INFINITY,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x7f;
+	buffer[6] = 0xf0;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 0;
+	ASSERT.equal(Number.POSITIVE_INFINITY,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* neg inf */
+	buffer[0] = 0xff;
+	buffer[1] = 0xf0;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 0;
+	ASSERT.equal(Number.NEGATIVE_INFINITY,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0xff;
+	buffer[6] = 0xf0;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 0;
+	ASSERT.equal(Number.NEGATIVE_INFINITY,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Simple normalized values */
+
+	/* +/- 1.125 */
+	buffer[0] = 0x3f;
+	buffer[1] = 0xf2;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 0;
+	ASSERT.equal(1.125,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x3f;
+	buffer[6] = 0xf2;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 0;
+	ASSERT.equal(1.125,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0xbf;
+	buffer[1] = 0xf2;
+	buffer[2] = 0;
+	buffer[3] = 0;
+	buffer[4] = 0;
+	buffer[5] = 0;
+	buffer[6] = 0;
+	buffer[7] = 0;
+	ASSERT.equal(-1.125,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0xbf;
+	buffer[6] = 0xf2;
+	buffer[5] = 0;
+	buffer[4] = 0;
+	buffer[3] = 0;
+	buffer[2] = 0;
+	buffer[1] = 0;
+	buffer[0] = 0;
+	ASSERT.equal(-1.125,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* +/- 1.4397318913736026e+283 */
+	buffer[0] = 0x7a;
+	buffer[1] = 0xb8;
+	buffer[2] = 0xc9;
+	buffer[3] = 0x34;
+	buffer[4] = 0x72;
+	buffer[5] = 0x16;
+	buffer[6] = 0xf9;
+	buffer[7] = 0x0e;
+	ASSERT.equal(1.4397318913736026e+283,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x7a;
+	buffer[6] = 0xb8;
+	buffer[5] = 0xc9;
+	buffer[4] = 0x34;
+	buffer[3] = 0x72;
+	buffer[2] = 0x16;
+	buffer[1] = 0xf9;
+	buffer[0] = 0x0e;
+	ASSERT.equal(1.4397318913736026e+283,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0xfa;
+	buffer[1] = 0xb8;
+	buffer[2] = 0xc9;
+	buffer[3] = 0x34;
+	buffer[4] = 0x72;
+	buffer[5] = 0x16;
+	buffer[6] = 0xf9;
+	buffer[7] = 0x0e;
+	ASSERT.equal(-1.4397318913736026e+283,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0xfa;
+	buffer[6] = 0xb8;
+	buffer[5] = 0xc9;
+	buffer[4] = 0x34;
+	buffer[3] = 0x72;
+	buffer[2] = 0x16;
+	buffer[1] = 0xf9;
+	buffer[0] = 0x0e;
+	ASSERT.equal(-1.4397318913736026e+283,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Denormalized values */
+	/* +/- 8.82521232268344e-309 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x06;
+	buffer[2] = 0x58;
+	buffer[3] = 0x94;
+	buffer[4] = 0x13;
+	buffer[5] = 0x27;
+	buffer[6] = 0x8a;
+	buffer[7] = 0xcd;
+	ASSERT.equal(8.82521232268344e-309,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x00;
+	buffer[6] = 0x06;
+	buffer[5] = 0x58;
+	buffer[4] = 0x94;
+	buffer[3] = 0x13;
+	buffer[2] = 0x27;
+	buffer[1] = 0x8a;
+	buffer[0] = 0xcd;
+	ASSERT.equal(8.82521232268344e-309,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x06;
+	buffer[2] = 0x58;
+	buffer[3] = 0x94;
+	buffer[4] = 0x13;
+	buffer[5] = 0x27;
+	buffer[6] = 0x8a;
+	buffer[7] = 0xcd;
+	ASSERT.equal(-8.82521232268344e-309,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x80;
+	buffer[6] = 0x06;
+	buffer[5] = 0x58;
+	buffer[4] = 0x94;
+	buffer[3] = 0x13;
+	buffer[2] = 0x27;
+	buffer[1] = 0x8a;
+	buffer[0] = 0xcd;
+	ASSERT.equal(-8.82521232268344e-309,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Edge cases, maximum and minimum values */
+
+	/* Smallest denormalized value 5e-324 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x00;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	buffer[4] = 0x00;
+	buffer[5] = 0x00;
+	buffer[6] = 0x00;
+	buffer[7] = 0x01;
+	ASSERT.equal(5e-324,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x00;
+	buffer[6] = 0x00;
+	buffer[5] = 0x00;
+	buffer[4] = 0x00;
+	buffer[3] = 0x00;
+	buffer[2] = 0x00;
+	buffer[1] = 0x00;
+	buffer[0] = 0x01;
+	ASSERT.equal(5e-324,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x00;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	buffer[4] = 0x00;
+	buffer[5] = 0x00;
+	buffer[6] = 0x00;
+	buffer[7] = 0x01;
+	ASSERT.equal(-5e-324,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x80;
+	buffer[6] = 0x00;
+	buffer[5] = 0x00;
+	buffer[4] = 0x00;
+	buffer[3] = 0x00;
+	buffer[2] = 0x00;
+	buffer[1] = 0x00;
+	buffer[0] = 0x01;
+	ASSERT.equal(-5e-324,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Largest denormalized value 2.225073858507201e-308 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x0f;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	buffer[4] = 0xff;
+	buffer[5] = 0xff;
+	buffer[6] = 0xff;
+	buffer[7] = 0xff;
+	ASSERT.equal(2.225073858507201e-308,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x00;
+	buffer[6] = 0x0f;
+	buffer[5] = 0xff;
+	buffer[4] = 0xff;
+	buffer[3] = 0xff;
+	buffer[2] = 0xff;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(2.225073858507201e-308,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x0f;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	buffer[4] = 0xff;
+	buffer[5] = 0xff;
+	buffer[6] = 0xff;
+	buffer[7] = 0xff;
+	ASSERT.equal(-2.225073858507201e-308,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x80;
+	buffer[6] = 0x0f;
+	buffer[5] = 0xff;
+	buffer[4] = 0xff;
+	buffer[3] = 0xff;
+	buffer[2] = 0xff;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(-2.225073858507201e-308,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Smallest normalized value 2.2250738585072014e-308 */
+	buffer[0] = 0x00;
+	buffer[1] = 0x10;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	buffer[4] = 0x00;
+	buffer[5] = 0x00;
+	buffer[6] = 0x00;
+	buffer[7] = 0x00;
+	ASSERT.equal(2.2250738585072014e-308,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x00;
+	buffer[6] = 0x10;
+	buffer[5] = 0x00;
+	buffer[4] = 0x00;
+	buffer[3] = 0x00;
+	buffer[2] = 0x00;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(2.2250738585072014e-308,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0x80;
+	buffer[1] = 0x10;
+	buffer[2] = 0x00;
+	buffer[3] = 0x00;
+	buffer[4] = 0x00;
+	buffer[5] = 0x00;
+	buffer[6] = 0x00;
+	buffer[7] = 0x00;
+	ASSERT.equal(-2.2250738585072014e-308,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x80;
+	buffer[6] = 0x10;
+	buffer[5] = 0x00;
+	buffer[4] = 0x00;
+	buffer[3] = 0x00;
+	buffer[2] = 0x00;
+	buffer[1] = 0x00;
+	buffer[0] = 0x00;
+	ASSERT.equal(-2.2250738585072014e-308,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Largest normalized value 1.7976931348623157e+308 */
+	buffer[0] = 0x7f;
+	buffer[1] = 0xef;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	buffer[4] = 0xff;
+	buffer[5] = 0xff;
+	buffer[6] = 0xff;
+	buffer[7] = 0xff;
+	ASSERT.equal(1.7976931348623157e+308,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0x7f;
+	buffer[6] = 0xef;
+	buffer[5] = 0xff;
+	buffer[4] = 0xff;
+	buffer[3] = 0xff;
+	buffer[2] = 0xff;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(1.7976931348623157e+308,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	buffer[0] = 0xff;
+	buffer[1] = 0xef;
+	buffer[2] = 0xff;
+	buffer[3] = 0xff;
+	buffer[4] = 0xff;
+	buffer[5] = 0xff;
+	buffer[6] = 0xff;
+	buffer[7] = 0xff;
+	ASSERT.equal(-1.7976931348623157e+308,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+
+	buffer[7] = 0xff;
+	buffer[6] = 0xef;
+	buffer[5] = 0xff;
+	buffer[4] = 0xff;
+	buffer[3] = 0xff;
+	buffer[2] = 0xff;
+	buffer[1] = 0xff;
+	buffer[0] = 0xff;
+	ASSERT.equal(-1.7976931348623157e+308,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+
+	/* Try offsets */
+	buffer[0] = 0xde;
+	buffer[1] = 0xad;
+	buffer[2] = 0xbe;
+	buffer[3] = 0xef;
+	buffer[4] = 0xba;
+	buffer[5] = 0xdd;
+	buffer[6] = 0xca;
+	buffer[7] = 0xfe;
+	buffer[8] = 0x16;
+	buffer[9] = 0x79;
+
+	ASSERT.equal(-1.1885958404126936e+148,
+	    mod_ctype.rdouble(buffer, 'big', 0));
+	ASSERT.equal(-2.4299184080448593e-88,
+	    mod_ctype.rdouble(buffer, 'big', 1));
+	ASSERT.equal(-0.000015130017658081283,
+	    mod_ctype.rdouble(buffer, 'big', 2));
+
+	ASSERT.equal(-5.757458694845505e+302,
+	    mod_ctype.rdouble(buffer, 'little', 0));
+	ASSERT.equal(6.436459604192476e-198,
+	    mod_ctype.rdouble(buffer, 'little', 1));
+	ASSERT.equal(1.9903745632417286e+275,
+	    mod_ctype.rdouble(buffer, 'little', 2));
+}
+
+testfloat();
+testdouble();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/float/tst.wfloat.js	(revision 487)
@@ -0,0 +1,753 @@
+/*
+ * Another place to find bugs that may yet plague us. This time with writing out
+ * floats to arrays. We are lazy and did basically just take the opposite of our
+ * test code to read in values.
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+
+/*
+ *	A useful thing to keep around for debugging
+ *	console.log('buffer[0]: ' + buffer[0].toString(16));
+ *	console.log('buffer[1]: ' + buffer[1].toString(16));
+ *	console.log('buffer[2]: ' + buffer[2].toString(16));
+ *	console.log('buffer[3]: ' + buffer[3].toString(16));
+ *	console.log('buffer[4]: ' + buffer[4].toString(16));
+ *	console.log('buffer[5]: ' + buffer[5].toString(16));
+ * 	console.log('buffer[6]: ' + buffer[6].toString(16));
+ *	console.log('buffer[7]: ' + buffer[7].toString(16));
+ */
+
+function testfloat()
+{
+	var buffer = new Buffer(4);
+	mod_ctype.wfloat(0, 'big', buffer, 0);
+	/* Start off with some of the easy ones: +zero */
+	ASSERT.equal(0, buffer[0]);
+	ASSERT.equal(0, buffer[1]);
+	ASSERT.equal(0, buffer[2]);
+	ASSERT.equal(0, buffer[3]);
+	mod_ctype.wfloat(0, 'little', buffer, 0);
+	ASSERT.equal(0, buffer[0]);
+	ASSERT.equal(0, buffer[1]);
+	ASSERT.equal(0, buffer[2]);
+	ASSERT.equal(0, buffer[3]);
+
+	/* Catch +infin */
+	mod_ctype.wfloat(Number.POSITIVE_INFINITY, 'big', buffer, 0);
+	ASSERT.equal(0x7f, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	mod_ctype.wfloat(Number.POSITIVE_INFINITY, 'little', buffer, 0);
+	ASSERT.equal(0x7f, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	/* Catch -infin */
+	mod_ctype.wfloat(Number.NEGATIVE_INFINITY, 'big', buffer, 0);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	mod_ctype.wfloat(Number.NEGATIVE_INFINITY, 'little', buffer, 0);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	/* Catch NaN */
+
+	/*
+	 * NaN Is a litle weird in its requirements, so we're going to encode a
+	 * bit of how we actually implement it into this test. Probably not the
+	 * best, since technically the sign is a don't care and the mantissa
+	 * needs to just be non-zero.
+	 */
+	mod_ctype.wfloat(NaN, 'big', buffer, 0);
+	ASSERT.equal(0x7f, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x17, buffer[3]);
+	mod_ctype.wfloat(NaN, 'little', buffer, 0);
+	ASSERT.equal(0x7f, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x17, buffer[0]);
+
+	/* On to some basic tests */
+	/* 1.125 */
+	mod_ctype.wfloat(1.125, 'big', buffer, 0);
+	ASSERT.equal(0x3f, buffer[0]);
+	ASSERT.equal(0x90, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	mod_ctype.wfloat(1.125, 'little', buffer, 0);
+	ASSERT.equal(0x3f, buffer[3]);
+	ASSERT.equal(0x90, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	mod_ctype.wfloat(1.0000001192092896, 'big', buffer, 0);
+	ASSERT.equal(0x3f, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x01, buffer[3]);
+	mod_ctype.wfloat(1.0000001192092896, 'little', buffer, 0);
+	ASSERT.equal(0x3f, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+	mod_ctype.wfloat(1.0000001192092896, 'big', buffer, 0);
+	ASSERT.equal(0x3f, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x01, buffer[3]);
+	mod_ctype.wfloat(1.0000001192092896, 'little', buffer, 0);
+	ASSERT.equal(0x3f, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+	mod_ctype.wfloat(2.3283067140944524e-10, 'big', buffer, 0);
+	ASSERT.equal(0x2f, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x01, buffer[3]);
+	mod_ctype.wfloat(2.3283067140944524e-10, 'little', buffer, 0);
+	ASSERT.equal(0x2f, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+	/* ff34a2b0 -2.4010576103645774e+38 */
+	mod_ctype.wfloat(-2.4010576103645774e+38,
+	    'big', buffer, 0);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0x34, buffer[1]);
+	ASSERT.equal(0xa2, buffer[2]);
+	ASSERT.equal(0xb0, buffer[3]);
+	mod_ctype.wfloat(-2.4010576103645774e+38,
+	    'little', buffer, 0);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0x34, buffer[2]);
+	ASSERT.equal(0xa2, buffer[1]);
+	ASSERT.equal(0xb0, buffer[0]);
+
+	/* Denormalized tests */
+
+	/* 0003f89a +/- 3.6468792534053364e-40 */
+	mod_ctype.wfloat(3.6468792534053364e-40,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x03, buffer[1]);
+	ASSERT.equal(0xf8, buffer[2]);
+	ASSERT.equal(0x9a, buffer[3]);
+	mod_ctype.wfloat(3.6468792534053364e-40,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x03, buffer[2]);
+	ASSERT.equal(0xf8, buffer[1]);
+	ASSERT.equal(0x9a, buffer[0]);
+
+	mod_ctype.wfloat(-3.6468792534053364e-40,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x03, buffer[1]);
+	ASSERT.equal(0xf8, buffer[2]);
+	ASSERT.equal(0x9a, buffer[3]);
+	mod_ctype.wfloat(-3.6468792534053364e-40,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[3]);
+	ASSERT.equal(0x03, buffer[2]);
+	ASSERT.equal(0xf8, buffer[1]);
+	ASSERT.equal(0x9a, buffer[0]);
+
+	/* Maximum and minimum normalized and denormalized values */
+
+	/* Largest normalized number +/- 3.4028234663852886e+38 */
+
+	mod_ctype.wfloat(3.4028234663852886e+38,
+	    'big', buffer, 0);
+	ASSERT.equal(0x7f, buffer[0]);
+	ASSERT.equal(0x7f, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	mod_ctype.wfloat(3.4028234663852886e+38,
+	    'little', buffer, 0);
+	ASSERT.equal(0x7f, buffer[3]);
+	ASSERT.equal(0x7f, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+	mod_ctype.wfloat(-3.4028234663852886e+38,
+	    'big', buffer, 0);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0x7f, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	mod_ctype.wfloat(-3.4028234663852886e+38,
+	    'little', buffer, 0);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0x7f, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+	/* Smallest normalied number +/- 1.1754943508222875e-38 */
+
+	mod_ctype.wfloat(1.1754943508222875e-38,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	mod_ctype.wfloat(1.1754943508222875e-38,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	mod_ctype.wfloat(-1.1754943508222875e-38,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x80, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	mod_ctype.wfloat(-1.1754943508222875e-38,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[3]);
+	ASSERT.equal(0x80, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	/* Smallest denormalized number 1.401298464324817e-45 */
+	mod_ctype.wfloat(1.401298464324817e-45,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x01, buffer[3]);
+	mod_ctype.wfloat(1.401298464324817e-45,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+	mod_ctype.wfloat(-1.401298464324817e-45,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x01, buffer[3]);
+	mod_ctype.wfloat(-1.401298464324817e-45,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+	/* Largest denormalized value +/- 1.1754942106924411e-38 */
+
+	mod_ctype.wfloat(1.1754942106924411e-38,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x7f, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	mod_ctype.wfloat(1.1754942106924411e-38,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x7f, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+	mod_ctype.wfloat(-1.1754942106924411e-38,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x7f, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	mod_ctype.wfloat(-1.1754942106924411e-38,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[3]);
+	ASSERT.equal(0x7f, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+	/* Do some quick offset testing */
+	buffer = new Buffer(6);
+	mod_ctype.wfloat(-1.2027516403607578e-32,
+	    'big', buffer, 2);
+	ASSERT.equal(0x8a, buffer[2]);
+	ASSERT.equal(0x79, buffer[3]);
+	ASSERT.equal(0xcd, buffer[4]);
+	ASSERT.equal(0x3f, buffer[5]);
+
+	mod_ctype.wfloat(-1.2027516403607578e-32,
+	    'little', buffer, 2);
+	ASSERT.equal(0x8a, buffer[5]);
+	ASSERT.equal(0x79, buffer[4]);
+	ASSERT.equal(0xcd, buffer[3]);
+	ASSERT.equal(0x3f, buffer[2]);
+
+}
+
+function testdouble()
+{
+	var buffer = new Buffer(10);
+
+	/* Check 0 */
+	mod_ctype.wdouble(0, 'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+	mod_ctype.wdouble(0, 'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[7]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	/* Check NaN */
+	/* Similar to floats we are only generating a subset of values */
+	mod_ctype.wdouble(NaN, 'big', buffer, 0);
+	ASSERT.equal(0x7f, buffer[0]);
+	ASSERT.equal(0xf0, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x17, buffer[7]);
+	mod_ctype.wdouble(NaN, 'little', buffer, 0);
+	ASSERT.equal(0x7f, buffer[7]);
+	ASSERT.equal(0xf0, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x17, buffer[0]);
+
+	/* pos inf */
+	mod_ctype.wdouble(Number.POSITIVE_INFINITY,
+	    'big', buffer, 0);
+	ASSERT.equal(0x7f, buffer[0]);
+	ASSERT.equal(0xf0, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+	mod_ctype.wdouble(Number.POSITIVE_INFINITY,
+	    'little', buffer, 0);
+	ASSERT.equal(0x7f, buffer[7]);
+	ASSERT.equal(0xf0, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	/* neg inf */
+	mod_ctype.wdouble(Number.NEGATIVE_INFINITY,
+	    'big', buffer, 0);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0xf0, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+	mod_ctype.wdouble(Number.NEGATIVE_INFINITY,
+	    'little', buffer, 0);
+	ASSERT.equal(0xff, buffer[7]);
+	ASSERT.equal(0xf0, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	/* Simple normalized values */
+
+	/* +/- 1.125 */
+	mod_ctype.wdouble(1.125,
+	    'big', buffer, 0);
+	ASSERT.equal(0x3f, buffer[0]);
+	ASSERT.equal(0xf2, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+
+	mod_ctype.wdouble(1.125,
+	    'little', buffer, 0);
+	ASSERT.equal(0x3f, buffer[7]);
+	ASSERT.equal(0xf2, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	mod_ctype.wdouble(-1.125,
+	    'big', buffer, 0);
+	ASSERT.equal(0xbf, buffer[0]);
+	ASSERT.equal(0xf2, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+
+	mod_ctype.wdouble(-1.125,
+	    'little', buffer, 0);
+	ASSERT.equal(0xbf, buffer[7]);
+	ASSERT.equal(0xf2, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+
+	/* +/- 1.4397318913736026e+283 */
+	mod_ctype.wdouble(1.4397318913736026e+283,
+	    'big', buffer, 0);
+	ASSERT.equal(0x7a, buffer[0]);
+	ASSERT.equal(0xb8, buffer[1]);
+	ASSERT.equal(0xc9, buffer[2]);
+	ASSERT.equal(0x34, buffer[3]);
+	ASSERT.equal(0x72, buffer[4]);
+	ASSERT.equal(0x16, buffer[5]);
+	ASSERT.equal(0xf9, buffer[6]);
+	ASSERT.equal(0x0e, buffer[7]);
+
+	mod_ctype.wdouble(1.4397318913736026e+283,
+	    'little', buffer, 0);
+	ASSERT.equal(0x7a, buffer[7]);
+	ASSERT.equal(0xb8, buffer[6]);
+	ASSERT.equal(0xc9, buffer[5]);
+	ASSERT.equal(0x34, buffer[4]);
+	ASSERT.equal(0x72, buffer[3]);
+	ASSERT.equal(0x16, buffer[2]);
+	ASSERT.equal(0xf9, buffer[1]);
+	ASSERT.equal(0x0e, buffer[0]);
+
+	mod_ctype.wdouble(-1.4397318913736026e+283,
+	    'big', buffer, 0);
+	ASSERT.equal(0xfa, buffer[0]);
+	ASSERT.equal(0xb8, buffer[1]);
+	ASSERT.equal(0xc9, buffer[2]);
+	ASSERT.equal(0x34, buffer[3]);
+	ASSERT.equal(0x72, buffer[4]);
+	ASSERT.equal(0x16, buffer[5]);
+	ASSERT.equal(0xf9, buffer[6]);
+	ASSERT.equal(0x0e, buffer[7]);
+
+	mod_ctype.wdouble(-1.4397318913736026e+283,
+	    'little', buffer, 0);
+	ASSERT.equal(0xfa, buffer[7]);
+	ASSERT.equal(0xb8, buffer[6]);
+	ASSERT.equal(0xc9, buffer[5]);
+	ASSERT.equal(0x34, buffer[4]);
+	ASSERT.equal(0x72, buffer[3]);
+	ASSERT.equal(0x16, buffer[2]);
+	ASSERT.equal(0xf9, buffer[1]);
+	ASSERT.equal(0x0e, buffer[0]);
+
+	/* Denormalized values */
+	/* +/- 8.82521232268344e-309 */
+	mod_ctype.wdouble(8.82521232268344e-309,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x06, buffer[1]);
+	ASSERT.equal(0x58, buffer[2]);
+	ASSERT.equal(0x94, buffer[3]);
+	ASSERT.equal(0x13, buffer[4]);
+	ASSERT.equal(0x27, buffer[5]);
+	ASSERT.equal(0x8a, buffer[6]);
+	ASSERT.equal(0xcd, buffer[7]);
+
+	mod_ctype.wdouble(8.82521232268344e-309,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[7]);
+	ASSERT.equal(0x06, buffer[6]);
+	ASSERT.equal(0x58, buffer[5]);
+	ASSERT.equal(0x94, buffer[4]);
+	ASSERT.equal(0x13, buffer[3]);
+	ASSERT.equal(0x27, buffer[2]);
+	ASSERT.equal(0x8a, buffer[1]);
+	ASSERT.equal(0xcd, buffer[0]);
+
+	mod_ctype.wdouble(-8.82521232268344e-309,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x06, buffer[1]);
+	ASSERT.equal(0x58, buffer[2]);
+	ASSERT.equal(0x94, buffer[3]);
+	ASSERT.equal(0x13, buffer[4]);
+	ASSERT.equal(0x27, buffer[5]);
+	ASSERT.equal(0x8a, buffer[6]);
+	ASSERT.equal(0xcd, buffer[7]);
+
+	mod_ctype.wdouble(-8.82521232268344e-309,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[7]);
+	ASSERT.equal(0x06, buffer[6]);
+	ASSERT.equal(0x58, buffer[5]);
+	ASSERT.equal(0x94, buffer[4]);
+	ASSERT.equal(0x13, buffer[3]);
+	ASSERT.equal(0x27, buffer[2]);
+	ASSERT.equal(0x8a, buffer[1]);
+	ASSERT.equal(0xcd, buffer[0]);
+
+
+	/* Edge cases, maximum and minimum values */
+
+	/* Smallest denormalized value 5e-324 */
+	mod_ctype.wdouble(5e-324,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x01, buffer[7]);
+
+	mod_ctype.wdouble(5e-324,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[7]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+	mod_ctype.wdouble(-5e-324,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x01, buffer[7]);
+
+	mod_ctype.wdouble(-5e-324,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[7]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x01, buffer[0]);
+
+
+
+	/* Largest denormalized value 2.225073858507201e-308 */
+	mod_ctype.wdouble(2.225073858507201e-308,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x0f, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[6]);
+	ASSERT.equal(0xff, buffer[7]);
+
+	mod_ctype.wdouble(2.225073858507201e-308,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[7]);
+	ASSERT.equal(0x0f, buffer[6]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+	mod_ctype.wdouble(-2.225073858507201e-308,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x0f, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[6]);
+	ASSERT.equal(0xff, buffer[7]);
+
+	mod_ctype.wdouble(-2.225073858507201e-308,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[7]);
+	ASSERT.equal(0x0f, buffer[6]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+
+	/* Smallest normalized value 2.2250738585072014e-308 */
+	mod_ctype.wdouble(2.2250738585072014e-308,
+	    'big', buffer, 0);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x10, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+
+	mod_ctype.wdouble(2.2250738585072014e-308,
+	    'little', buffer, 0);
+	ASSERT.equal(0x00, buffer[7]);
+	ASSERT.equal(0x10, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+	mod_ctype.wdouble(-2.2250738585072014e-308,
+	    'big', buffer, 0);
+	ASSERT.equal(0x80, buffer[0]);
+	ASSERT.equal(0x10, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+
+	mod_ctype.wdouble(-2.2250738585072014e-308,
+	    'little', buffer, 0);
+	ASSERT.equal(0x80, buffer[7]);
+	ASSERT.equal(0x10, buffer[6]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[4]);
+	ASSERT.equal(0x00, buffer[3]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[0]);
+
+
+	/* Largest normalized value 1.7976931348623157e+308 */
+	mod_ctype.wdouble(1.7976931348623157e+308,
+	    'big', buffer, 0);
+	ASSERT.equal(0x7f, buffer[0]);
+	ASSERT.equal(0xef, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[6]);
+	ASSERT.equal(0xff, buffer[7]);
+
+	mod_ctype.wdouble(1.7976931348623157e+308,
+	    'little', buffer, 0);
+	ASSERT.equal(0x7f, buffer[7]);
+	ASSERT.equal(0xef, buffer[6]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+	mod_ctype.wdouble(-1.7976931348623157e+308,
+	    'big', buffer, 0);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0xef, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[6]);
+	ASSERT.equal(0xff, buffer[7]);
+
+	mod_ctype.wdouble(-1.7976931348623157e+308,
+	    'little', buffer, 0);
+	ASSERT.equal(0xff, buffer[7]);
+	ASSERT.equal(0xef, buffer[6]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[4]);
+	ASSERT.equal(0xff, buffer[3]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[0]);
+
+
+	/* Try offsets */
+	buffer[0] = 0xde;
+	buffer[1] = 0xad;
+	buffer[2] = 0xbe;
+	buffer[3] = 0xef;
+	buffer[4] = 0xba;
+	buffer[5] = 0xdd;
+	buffer[6] = 0xca;
+	buffer[7] = 0xfe;
+	buffer[8] = 0x16;
+	buffer[9] = 0x79;
+
+	mod_ctype.wdouble(-0.000015130017658081283,
+	    'big', buffer, 2);
+	ASSERT.equal(0xbe, buffer[2]);
+	ASSERT.equal(0xef, buffer[3]);
+	ASSERT.equal(0xba, buffer[4]);
+	ASSERT.equal(0xdd, buffer[5]);
+	ASSERT.equal(0xca, buffer[6]);
+	ASSERT.equal(0xfe, buffer[7]);
+	ASSERT.equal(0x16, buffer[8]);
+	ASSERT.equal(0x79, buffer[9]);
+
+	mod_ctype.wdouble(-0.000015130017658081283,
+	    'little', buffer, 2);
+	ASSERT.equal(0xbe, buffer[9]);
+	ASSERT.equal(0xef, buffer[8]);
+	ASSERT.equal(0xba, buffer[7]);
+	ASSERT.equal(0xdd, buffer[6]);
+	ASSERT.equal(0xca, buffer[5]);
+	ASSERT.equal(0xfe, buffer[4]);
+	ASSERT.equal(0x16, buffer[3]);
+	ASSERT.equal(0x79, buffer[2]);
+}
+
+testfloat();
+testdouble();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.64.js	(revision 487)
@@ -0,0 +1,638 @@
+/*
+ * Test our ability to read and write signed 64-bit integers.
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+function testRead()
+{
+	var res, data;
+	data = new Buffer(10);
+
+	data[0] = 0x32;
+	data[1] = 0x65;
+	data[2] = 0x42;
+	data[3] = 0x56;
+	data[4] = 0x23;
+	data[5] = 0xff;
+	data[6] = 0xff;
+	data[7] = 0xff;
+	data[8] = 0x89;
+	data[9] = 0x11;
+	res = mod_ctype.rsint64(data, 'big', 0);
+	ASSERT.equal(0x32654256, res[0]);
+	ASSERT.equal(0x23ffffff, res[1]);
+	res = mod_ctype.rsint64(data, 'big', 1);
+	ASSERT.equal(0x65425623, res[0]);
+	ASSERT.equal(0xffffff89, res[1]);
+	res = mod_ctype.rsint64(data, 'big', 2);
+	ASSERT.equal(0x425623ff, res[0]);
+	ASSERT.equal(0xffff8911, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 0);
+	ASSERT.equal(-0x000000dc, res[0]);
+	ASSERT.equal(-0xa9bd9ace, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 1);
+	ASSERT.equal(-0x76000000, res[0]);
+	ASSERT.equal(-0xdca9bd9b, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 2);
+	ASSERT.equal(0x1189ffff, res[0]);
+	ASSERT.equal(0xff235642, res[1]);
+
+	data.fill(0x00);
+	res = mod_ctype.rsint64(data, 'big', 0);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(0x00000000, res[1]);
+	res = mod_ctype.rsint64(data, 'big', 1);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(0x00000000, res[1]);
+	res = mod_ctype.rsint64(data, 'big', 2);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(0x00000000, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 0);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(0x00000000, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 1);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(0x00000000, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 2);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(0x00000000, res[1]);
+
+	data.fill(0xff);
+	res = mod_ctype.rsint64(data, 'big', 0);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(-1, res[1]);
+	res = mod_ctype.rsint64(data, 'big', 1);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(-1, res[1]);
+	res = mod_ctype.rsint64(data, 'big', 2);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(-1, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 0);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(-1, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 1);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(-1, res[1]);
+	res = mod_ctype.rsint64(data, 'little', 2);
+	ASSERT.equal(0x00000000, res[0]);
+	ASSERT.equal(-1, res[1]);
+
+	data[0] = 0x80;
+	data[1] = 0x00;
+	data[2] = 0x00;
+	data[3] = 0x00;
+	data[4] = 0x00;
+	data[5] = 0x00;
+	data[6] = 0x00;
+	data[7] = 0x00;
+	res = mod_ctype.rsint64(data, 'big', 0);
+	ASSERT.equal(-0x80000000, res[0]);
+	ASSERT.equal(0, res[1]);
+
+
+	data[7] = 0x80;
+	data[6] = 0x00;
+	data[5] = 0x00;
+	data[4] = 0x00;
+	data[3] = 0x00;
+	data[2] = 0x00;
+	data[1] = 0x00;
+	data[0] = 0x00;
+	res = mod_ctype.rsint64(data, 'little', 0);
+	ASSERT.equal(-0x80000000, res[0]);
+	ASSERT.equal(0, res[1]);
+
+	data[0] = 0x80;
+	data[1] = 0x00;
+	data[2] = 0x00;
+	data[3] = 0x00;
+	data[4] = 0x00;
+	data[5] = 0x00;
+	data[6] = 0x00;
+	data[7] = 0x01;
+	res = mod_ctype.rsint64(data, 'big', 0);
+	ASSERT.equal(-0x7fffffff, res[0]);
+	ASSERT.equal(-0xffffffff, res[1]);
+
+
+}
+
+function testWriteZero()
+{
+	var data, buf;
+	buf = new Buffer(10);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wsint64(data, 'big', buf, 0);
+	ASSERT.equal(0, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wsint64(data, 'big', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wsint64(data, 'big', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0, buf[9]);
+
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wsint64(data, 'little', buf, 0);
+	ASSERT.equal(0, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wsint64(data, 'little', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wsint64(data, 'little', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0, buf[9]);
+}
+
+/*
+ * Also include tests that are going to force us to go into a negative value and
+ * insure that it's written correctly.
+ */
+function testWrite()
+{
+	var data, buf;
+
+	buf = new Buffer(10);
+	data = [ 0x234456, 0x87 ];
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 0);
+	ASSERT.equal(0x00, buf[0]);
+	ASSERT.equal(0x23, buf[1]);
+	ASSERT.equal(0x44, buf[2]);
+	ASSERT.equal(0x56, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x87, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x23, buf[2]);
+	ASSERT.equal(0x44, buf[3]);
+	ASSERT.equal(0x56, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x87, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x23, buf[3]);
+	ASSERT.equal(0x44, buf[4]);
+	ASSERT.equal(0x56, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x00, buf[8]);
+	ASSERT.equal(0x87, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 0);
+	ASSERT.equal(0x87, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x56, buf[4]);
+	ASSERT.equal(0x44, buf[5]);
+	ASSERT.equal(0x23, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x87, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x56, buf[5]);
+	ASSERT.equal(0x44, buf[6]);
+	ASSERT.equal(0x23, buf[7]);
+	ASSERT.equal(0x00, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0x87, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x56, buf[6]);
+	ASSERT.equal(0x44, buf[7]);
+	ASSERT.equal(0x23, buf[8]);
+	ASSERT.equal(0x00, buf[9]);
+
+	data = [0x3421, 0x34abcdba];
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 0);
+	ASSERT.equal(0x00, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x34, buf[2]);
+	ASSERT.equal(0x21, buf[3]);
+	ASSERT.equal(0x34, buf[4]);
+	ASSERT.equal(0xab, buf[5]);
+	ASSERT.equal(0xcd, buf[6]);
+	ASSERT.equal(0xba, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x34, buf[3]);
+	ASSERT.equal(0x21, buf[4]);
+	ASSERT.equal(0x34, buf[5]);
+	ASSERT.equal(0xab, buf[6]);
+	ASSERT.equal(0xcd, buf[7]);
+	ASSERT.equal(0xba, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x34, buf[4]);
+	ASSERT.equal(0x21, buf[5]);
+	ASSERT.equal(0x34, buf[6]);
+	ASSERT.equal(0xab, buf[7]);
+	ASSERT.equal(0xcd, buf[8]);
+	ASSERT.equal(0xba, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 0);
+	ASSERT.equal(0xba, buf[0]);
+	ASSERT.equal(0xcd, buf[1]);
+	ASSERT.equal(0xab, buf[2]);
+	ASSERT.equal(0x34, buf[3]);
+	ASSERT.equal(0x21, buf[4]);
+	ASSERT.equal(0x34, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0xba, buf[1]);
+	ASSERT.equal(0xcd, buf[2]);
+	ASSERT.equal(0xab, buf[3]);
+	ASSERT.equal(0x34, buf[4]);
+	ASSERT.equal(0x21, buf[5]);
+	ASSERT.equal(0x34, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x00, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0xba, buf[2]);
+	ASSERT.equal(0xcd, buf[3]);
+	ASSERT.equal(0xab, buf[4]);
+	ASSERT.equal(0x34, buf[5]);
+	ASSERT.equal(0x21, buf[6]);
+	ASSERT.equal(0x34, buf[7]);
+	ASSERT.equal(0x00, buf[8]);
+	ASSERT.equal(0x00, buf[9]);
+
+
+	data = [ -0x80000000, 0 ];
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 0);
+	ASSERT.equal(0x80, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 0);
+	ASSERT.equal(0x00, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x80, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	data = [ -0x7fffffff, -0xffffffff ];
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 0);
+	ASSERT.equal(0x80, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x01, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 0);
+	ASSERT.equal(0x01, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x80, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	data = [ 0x0, -0x1];
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'big', buf, 0);
+	ASSERT.equal(0xff, buf[0]);
+	ASSERT.equal(0xff, buf[1]);
+	ASSERT.equal(0xff, buf[2]);
+	ASSERT.equal(0xff, buf[3]);
+	ASSERT.equal(0xff, buf[4]);
+	ASSERT.equal(0xff, buf[5]);
+	ASSERT.equal(0xff, buf[6]);
+	ASSERT.equal(0xff, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wsint64(data, 'little', buf, 0);
+	ASSERT.equal(0xff, buf[0]);
+	ASSERT.equal(0xff, buf[1]);
+	ASSERT.equal(0xff, buf[2]);
+	ASSERT.equal(0xff, buf[3]);
+	ASSERT.equal(0xff, buf[4]);
+	ASSERT.equal(0xff, buf[5]);
+	ASSERT.equal(0xff, buf[6]);
+	ASSERT.equal(0xff, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+}
+
+/*
+ * Make sure we catch invalid writes.
+ */
+function testWriteInvalid()
+{
+	var data, buf;
+
+	/* Buffer too small */
+	buf = new Buffer(4);
+	data = [ 0, 0];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 0);
+	}, Error, 'buffer too small');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 0);
+	}, Error, 'buffer too small');
+
+	/* Beyond the end of the buffer */
+	buf = new Buffer(12);
+	data = [ 0, 0];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 11);
+	}, Error, 'write beyond end of buffer');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 11);
+	}, Error, 'write beyond end of buffer');
+
+	/* Write fractional values */
+	buf = new Buffer(12);
+	data = [ 3.33, 0 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ 0, 3.3 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ -3.33, 0 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ 0, -3.3 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ 3.33, 2.42 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ 3.33, -2.42 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ -3.33, -2.42 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ -3.33, 2.42 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	/* Signs don't match */
+	buf = new Buffer(12);
+	data = [ 0x800000, -0x32 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ -0x800000, 0x32 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	/* Write values that are too large */
+	buf = new Buffer(12);
+	data = [ 0x80000000, 0 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ 0x7fffffff, 0x100000000 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ 0x00, 0x800000000 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ 0xffffffffff, 0xffffff238 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ 0x23, 0xffffff238 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ -0x80000000, -0xfff238 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ -0x80000004, -0xfff238 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wsint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+}
+
+
+testRead();
+testWrite();
+testWriteZero();
+testWriteInvalid();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.rint.js	(revision 487)
@@ -0,0 +1,101 @@
+/*
+ * Tests to verify we're reading in signed integers correctly
+ */
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+/*
+ * Test 8 bit signed integers
+ */
+function test8()
+{
+	var data = new Buffer(4);
+
+	data[0] = 0x23;
+	ASSERT.equal(0x23, mod_ctype.rsint8(data, 'big', 0));
+	ASSERT.equal(0x23, mod_ctype.rsint8(data, 'little', 0));
+
+	data[0] = 0xff;
+	ASSERT.equal(-1, mod_ctype.rsint8(data, 'big', 0));
+	ASSERT.equal(-1, mod_ctype.rsint8(data, 'little', 0));
+
+	data[0] = 0x87;
+	data[1] = 0xab;
+	data[2] = 0x7c;
+	data[3] = 0xef;
+	ASSERT.equal(-121, mod_ctype.rsint8(data, 'big', 0));
+	ASSERT.equal(-85, mod_ctype.rsint8(data, 'big', 1));
+	ASSERT.equal(124, mod_ctype.rsint8(data, 'big', 2));
+	ASSERT.equal(-17, mod_ctype.rsint8(data, 'big', 3));
+	ASSERT.equal(-121, mod_ctype.rsint8(data, 'little', 0));
+	ASSERT.equal(-85, mod_ctype.rsint8(data, 'little', 1));
+	ASSERT.equal(124, mod_ctype.rsint8(data, 'little', 2));
+	ASSERT.equal(-17, mod_ctype.rsint8(data, 'little', 3));
+}
+
+function test16()
+{
+	var buffer = new Buffer(6);
+	buffer[0] = 0x16;
+	buffer[1] = 0x79;
+	ASSERT.equal(0x1679, mod_ctype.rsint16(buffer, 'big', 0));
+	ASSERT.equal(0x7916, mod_ctype.rsint16(buffer, 'little', 0));
+
+	buffer[0] = 0xff;
+	buffer[1] = 0x80;
+	ASSERT.equal(-128, mod_ctype.rsint16(buffer, 'big', 0));
+	ASSERT.equal(-32513, mod_ctype.rsint16(buffer, 'little', 0));
+
+	/* test offset with weenix */
+	buffer[0] = 0x77;
+	buffer[1] = 0x65;
+	buffer[2] = 0x65;
+	buffer[3] = 0x6e;
+	buffer[4] = 0x69;
+	buffer[5] = 0x78;
+	ASSERT.equal(0x7765, mod_ctype.rsint16(buffer, 'big', 0));
+	ASSERT.equal(0x6565, mod_ctype.rsint16(buffer, 'big', 1));
+	ASSERT.equal(0x656e, mod_ctype.rsint16(buffer, 'big', 2));
+	ASSERT.equal(0x6e69, mod_ctype.rsint16(buffer, 'big', 3));
+	ASSERT.equal(0x6978, mod_ctype.rsint16(buffer, 'big', 4));
+	ASSERT.equal(0x6577, mod_ctype.rsint16(buffer, 'little', 0));
+	ASSERT.equal(0x6565, mod_ctype.rsint16(buffer, 'little', 1));
+	ASSERT.equal(0x6e65, mod_ctype.rsint16(buffer, 'little', 2));
+	ASSERT.equal(0x696e, mod_ctype.rsint16(buffer, 'little', 3));
+	ASSERT.equal(0x7869, mod_ctype.rsint16(buffer, 'little', 4));
+}
+
+function test32()
+{
+	var buffer = new Buffer(6);
+	buffer[0] = 0x43;
+	buffer[1] = 0x53;
+	buffer[2] = 0x16;
+	buffer[3] = 0x79;
+	ASSERT.equal(0x43531679, mod_ctype.rsint32(buffer, 'big', 0));
+	ASSERT.equal(0x79165343, mod_ctype.rsint32(buffer, 'little', 0));
+
+	buffer[0] = 0xff;
+	buffer[1] = 0xfe;
+	buffer[2] = 0xef;
+	buffer[3] = 0xfa;
+	ASSERT.equal(-69638, mod_ctype.rsint32(buffer, 'big', 0));
+	ASSERT.equal(-84934913, mod_ctype.rsint32(buffer, 'little', 0));
+
+	buffer[0] = 0x42;
+	buffer[1] = 0xc3;
+	buffer[2] = 0x95;
+	buffer[3] = 0xa9;
+	buffer[4] = 0x36;
+	buffer[5] = 0x17;
+	ASSERT.equal(0x42c395a9, mod_ctype.rsint32(buffer, 'big', 0));
+	ASSERT.equal(-1013601994, mod_ctype.rsint32(buffer, 'big', 1));
+	ASSERT.equal(-1784072681, mod_ctype.rsint32(buffer, 'big', 2));
+	ASSERT.equal(-1449802942, mod_ctype.rsint32(buffer, 'little', 0));
+	ASSERT.equal(917083587, mod_ctype.rsint32(buffer, 'little', 1));
+	ASSERT.equal(389458325, mod_ctype.rsint32(buffer, 'little', 2));
+}
+
+test8();
+test16();
+test32();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wbounds.js	(revision 487)
@@ -0,0 +1,53 @@
+/*
+ * Test to make sure that we properly are erroring whenever we try to write
+ * beyond the size of the integer.
+ */
+
+var mod_ctio = require('../../../ctio.js');
+var mod_assert = require('assert');
+var tb = new Buffer(16); /* Largest buffer we'll need */
+
+var cases = [
+	{ func:
+	function () {
+		mod_ctio.wsint8(0x80, 'big', tb, 0);
+	}, test: '+int8_t' },
+	{ func:
+	function () {
+		mod_ctio.wsint8(-0x81, 'big', tb, 0);
+	}, test: '-int8_t' },
+
+	{ func:
+	function () {
+		mod_ctio.wsint16(0x8000, 'big', tb, 0);
+	}, test: '+int16_t' },
+	{ func:
+	function () {
+		mod_ctio.wsint16(-0x8001, 'big', tb, 0);
+	}, test: '-int16_t' },
+	{ func:
+	function () {
+		mod_ctio.wsint32(0x80000000, 'big', tb, 0);
+	}, test: '+int32_t' },
+	{ func:
+	function () {
+		mod_ctio.wsint32(-0x80000001, 'big', tb, 0);
+	}, test: '-int32_t' },
+	{ func:
+	function () {
+		mod_ctio.wsint64([ 0x80000000, 0 ], 'big', tb, 0);
+	}, test: '+int64_t' },
+	{ func:
+	function () {
+		mod_ctio.wsint64([ -0x80000000, -1 ], 'big', tb, 0);
+	}, test: '-int64_t' }
+];
+
+function test()
+{
+	var ii;
+	for (ii = 0; ii < cases.length; ii++)
+		mod_assert.throws(cases[ii]['func'], Error, cases[ii]['test']);
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/int/tst.wint.js	(revision 487)
@@ -0,0 +1,92 @@
+/*
+ * Tests to verify we're writing signed integers correctly
+ */
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+function test8()
+{
+	var buffer = new Buffer(4);
+	mod_ctype.wsint8(0x23, 'big', buffer, 0);
+	mod_ctype.wsint8(0x23, 'little', buffer, 1);
+	mod_ctype.wsint8(-5, 'big', buffer, 2);
+	mod_ctype.wsint8(-5, 'little', buffer, 3);
+
+	ASSERT.equal(0x23, buffer[0]);
+	ASSERT.equal(0x23, buffer[1]);
+	ASSERT.equal(0xfb, buffer[2]);
+	ASSERT.equal(0xfb, buffer[3]);
+
+	/* Make sure we handle truncation correctly */
+	ASSERT.throws(function () {
+	     mod_ctype.wsint8(0xabc, 'big', buffer, 0);
+	});
+	ASSERT.throws(function () {
+	     mod_ctype.wsint8(0xabc, 'little', buffer, 0);
+	});
+}
+
+function test16()
+{
+	var buffer = new Buffer(6);
+	mod_ctype.wsint16(0x0023, 'big', buffer, 0);
+	mod_ctype.wsint16(0x0023, 'little', buffer, 2);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x23, buffer[1]);
+	ASSERT.equal(0x23, buffer[2]);
+	ASSERT.equal(0x00, buffer[3]);
+	mod_ctype.wsint16(-5, 'big', buffer, 0);
+	mod_ctype.wsint16(-5, 'little', buffer, 2);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0xfb, buffer[1]);
+	ASSERT.equal(0xfb, buffer[2]);
+	ASSERT.equal(0xff, buffer[3]);
+
+	mod_ctype.wsint16(-1679, 'big', buffer, 1);
+	mod_ctype.wsint16(-1679, 'little', buffer, 3);
+	ASSERT.equal(0xf9, buffer[1]);
+	ASSERT.equal(0x71, buffer[2]);
+	ASSERT.equal(0x71, buffer[3]);
+	ASSERT.equal(0xf9, buffer[4]);
+}
+
+function test32()
+{
+	var buffer = new Buffer(8);
+	mod_ctype.wsint32(0x23, 'big', buffer, 0);
+	mod_ctype.wsint32(0x23, 'little', buffer, 4);
+	ASSERT.equal(0x00, buffer[0]);
+	ASSERT.equal(0x00, buffer[1]);
+	ASSERT.equal(0x00, buffer[2]);
+	ASSERT.equal(0x23, buffer[3]);
+	ASSERT.equal(0x23, buffer[4]);
+	ASSERT.equal(0x00, buffer[5]);
+	ASSERT.equal(0x00, buffer[6]);
+	ASSERT.equal(0x00, buffer[7]);
+
+	mod_ctype.wsint32(-5, 'big', buffer, 0);
+	mod_ctype.wsint32(-5, 'little', buffer, 4);
+	ASSERT.equal(0xff, buffer[0]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xff, buffer[2]);
+	ASSERT.equal(0xfb, buffer[3]);
+	ASSERT.equal(0xfb, buffer[4]);
+	ASSERT.equal(0xff, buffer[5]);
+	ASSERT.equal(0xff, buffer[6]);
+	ASSERT.equal(0xff, buffer[7]);
+
+	mod_ctype.wsint32(-805306713, 'big', buffer, 0);
+	mod_ctype.wsint32(-805306713, 'litle', buffer, 4);
+	ASSERT.equal(0xcf, buffer[0]);
+	ASSERT.equal(0xff, buffer[1]);
+	ASSERT.equal(0xfe, buffer[2]);
+	ASSERT.equal(0xa7, buffer[3]);
+	ASSERT.equal(0xa7, buffer[4]);
+	ASSERT.equal(0xfe, buffer[5]);
+	ASSERT.equal(0xff, buffer[6]);
+	ASSERT.equal(0xcf, buffer[7]);
+}
+
+test8();
+test16();
+test32();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.64.js	(revision 487)
@@ -0,0 +1,451 @@
+/*
+ * Test our ability to read and write unsigned 64-bit integers.
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+function testRead()
+{
+	var res, data;
+	data = new Buffer(10);
+
+	data[0] = 0x32;
+	data[1] = 0x65;
+	data[2] = 0x42;
+	data[3] = 0x56;
+	data[4] = 0x23;
+	data[5] = 0xff;
+	data[6] = 0xff;
+	data[7] = 0xff;
+	data[8] = 0x89;
+	data[9] = 0x11;
+	res = mod_ctype.ruint64(data, 'big', 0);
+	ASSERT.equal(0x32654256, res[0]);
+	ASSERT.equal(0x23ffffff, res[1]);
+	res = mod_ctype.ruint64(data, 'big', 1);
+	ASSERT.equal(0x65425623, res[0]);
+	ASSERT.equal(0xffffff89, res[1]);
+	res = mod_ctype.ruint64(data, 'big', 2);
+	ASSERT.equal(0x425623ff, res[0]);
+	ASSERT.equal(0xffff8911, res[1]);
+	res = mod_ctype.ruint64(data, 'little', 0);
+	ASSERT.equal(0xffffff23, res[0]);
+	ASSERT.equal(0x56426532, res[1]);
+	res = mod_ctype.ruint64(data, 'little', 1);
+	ASSERT.equal(0x89ffffff, res[0]);
+	ASSERT.equal(0x23564265, res[1]);
+	res = mod_ctype.ruint64(data, 'little', 2);
+	ASSERT.equal(0x1189ffff, res[0]);
+	ASSERT.equal(0xff235642, res[1]);
+
+}
+
+function testReadOver()
+{
+	var res, data;
+	data = new Buffer(10);
+
+	data[0] = 0x80;
+	data[1] = 0xff;
+	data[2] = 0x80;
+	data[3] = 0xff;
+	data[4] = 0x80;
+	data[5] = 0xff;
+	data[6] = 0x80;
+	data[7] = 0xff;
+	data[8] = 0x80;
+	data[9] = 0xff;
+	res = mod_ctype.ruint64(data, 'big', 0);
+	ASSERT.equal(0x80ff80ff, res[0]);
+	ASSERT.equal(0x80ff80ff, res[1]);
+	res = mod_ctype.ruint64(data, 'big', 1);
+	ASSERT.equal(0xff80ff80, res[0]);
+	ASSERT.equal(0xff80ff80, res[1]);
+	res = mod_ctype.ruint64(data, 'big', 2);
+	ASSERT.equal(0x80ff80ff, res[0]);
+	ASSERT.equal(0x80ff80ff, res[1]);
+	res = mod_ctype.ruint64(data, 'little', 0);
+	ASSERT.equal(0xff80ff80, res[0]);
+	ASSERT.equal(0xff80ff80, res[1]);
+	res = mod_ctype.ruint64(data, 'little', 1);
+	ASSERT.equal(0x80ff80ff, res[0]);
+	ASSERT.equal(0x80ff80ff, res[1]);
+	res = mod_ctype.ruint64(data, 'little', 2);
+	ASSERT.equal(0xff80ff80, res[0]);
+	ASSERT.equal(0xff80ff80, res[1]);
+}
+
+function testWriteZero()
+{
+	var data, buf;
+	buf = new Buffer(10);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wuint64(data, 'big', buf, 0);
+	ASSERT.equal(0, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wuint64(data, 'big', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wuint64(data, 'big', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0, buf[9]);
+
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wuint64(data, 'little', buf, 0);
+	ASSERT.equal(0, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wuint64(data, 'little', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	data = [0, 0];
+	mod_ctype.wuint64(data, 'little', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0, buf[2]);
+	ASSERT.equal(0, buf[3]);
+	ASSERT.equal(0, buf[4]);
+	ASSERT.equal(0, buf[5]);
+	ASSERT.equal(0, buf[6]);
+	ASSERT.equal(0, buf[7]);
+	ASSERT.equal(0, buf[8]);
+	ASSERT.equal(0, buf[9]);
+}
+
+/*
+ * Also include tests that are going to force us to go into a negative value and
+ * insure that it's written correctly.
+ */
+function testWrite()
+{
+	var data, buf;
+
+	buf = new Buffer(10);
+	data = [ 0x234456, 0x87 ];
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'big', buf, 0);
+	ASSERT.equal(0x00, buf[0]);
+	ASSERT.equal(0x23, buf[1]);
+	ASSERT.equal(0x44, buf[2]);
+	ASSERT.equal(0x56, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x87, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'big', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x23, buf[2]);
+	ASSERT.equal(0x44, buf[3]);
+	ASSERT.equal(0x56, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x87, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'big', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x23, buf[3]);
+	ASSERT.equal(0x44, buf[4]);
+	ASSERT.equal(0x56, buf[5]);
+	ASSERT.equal(0x00, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x00, buf[8]);
+	ASSERT.equal(0x87, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'little', buf, 0);
+	ASSERT.equal(0x87, buf[0]);
+	ASSERT.equal(0x00, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x56, buf[4]);
+	ASSERT.equal(0x44, buf[5]);
+	ASSERT.equal(0x23, buf[6]);
+	ASSERT.equal(0x00, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'little', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x87, buf[1]);
+	ASSERT.equal(0x00, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x56, buf[5]);
+	ASSERT.equal(0x44, buf[6]);
+	ASSERT.equal(0x23, buf[7]);
+	ASSERT.equal(0x00, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'little', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0x87, buf[2]);
+	ASSERT.equal(0x00, buf[3]);
+	ASSERT.equal(0x00, buf[4]);
+	ASSERT.equal(0x00, buf[5]);
+	ASSERT.equal(0x56, buf[6]);
+	ASSERT.equal(0x44, buf[7]);
+	ASSERT.equal(0x23, buf[8]);
+	ASSERT.equal(0x00, buf[9]);
+
+	data = [0xffff3421, 0x34abcdba];
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'big', buf, 0);
+	ASSERT.equal(0xff, buf[0]);
+	ASSERT.equal(0xff, buf[1]);
+	ASSERT.equal(0x34, buf[2]);
+	ASSERT.equal(0x21, buf[3]);
+	ASSERT.equal(0x34, buf[4]);
+	ASSERT.equal(0xab, buf[5]);
+	ASSERT.equal(0xcd, buf[6]);
+	ASSERT.equal(0xba, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'big', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0xff, buf[1]);
+	ASSERT.equal(0xff, buf[2]);
+	ASSERT.equal(0x34, buf[3]);
+	ASSERT.equal(0x21, buf[4]);
+	ASSERT.equal(0x34, buf[5]);
+	ASSERT.equal(0xab, buf[6]);
+	ASSERT.equal(0xcd, buf[7]);
+	ASSERT.equal(0xba, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'big', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0xff, buf[2]);
+	ASSERT.equal(0xff, buf[3]);
+	ASSERT.equal(0x34, buf[4]);
+	ASSERT.equal(0x21, buf[5]);
+	ASSERT.equal(0x34, buf[6]);
+	ASSERT.equal(0xab, buf[7]);
+	ASSERT.equal(0xcd, buf[8]);
+	ASSERT.equal(0xba, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'little', buf, 0);
+	ASSERT.equal(0xba, buf[0]);
+	ASSERT.equal(0xcd, buf[1]);
+	ASSERT.equal(0xab, buf[2]);
+	ASSERT.equal(0x34, buf[3]);
+	ASSERT.equal(0x21, buf[4]);
+	ASSERT.equal(0x34, buf[5]);
+	ASSERT.equal(0xff, buf[6]);
+	ASSERT.equal(0xff, buf[7]);
+	ASSERT.equal(0x66, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'little', buf, 1);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0xba, buf[1]);
+	ASSERT.equal(0xcd, buf[2]);
+	ASSERT.equal(0xab, buf[3]);
+	ASSERT.equal(0x34, buf[4]);
+	ASSERT.equal(0x21, buf[5]);
+	ASSERT.equal(0x34, buf[6]);
+	ASSERT.equal(0xff, buf[7]);
+	ASSERT.equal(0xff, buf[8]);
+	ASSERT.equal(0x66, buf[9]);
+
+	buf.fill(0x66);
+	mod_ctype.wuint64(data, 'little', buf, 2);
+	ASSERT.equal(0x66, buf[0]);
+	ASSERT.equal(0x66, buf[1]);
+	ASSERT.equal(0xba, buf[2]);
+	ASSERT.equal(0xcd, buf[3]);
+	ASSERT.equal(0xab, buf[4]);
+	ASSERT.equal(0x34, buf[5]);
+	ASSERT.equal(0x21, buf[6]);
+	ASSERT.equal(0x34, buf[7]);
+	ASSERT.equal(0xff, buf[8]);
+	ASSERT.equal(0xff, buf[9]);
+}
+
+/*
+ * Make sure we catch invalid writes.
+ */
+function testWriteInvalid()
+{
+	var data, buf;
+
+	/* Buffer too small */
+	buf = new Buffer(4);
+	data = [ 0, 0];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 0);
+	}, Error, 'buffer too small');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 0);
+	}, Error, 'buffer too small');
+
+	/* Beyond the end of the buffer */
+	buf = new Buffer(12);
+	data = [ 0, 0];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 11);
+	}, Error, 'write beyond end of buffer');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 11);
+	}, Error, 'write beyond end of buffer');
+
+	/* Write negative values */
+	buf = new Buffer(12);
+	data = [ -3, 0 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write negative number');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write negative number');
+
+	data = [ 0, -3 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write negative number');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write negative number');
+
+	data = [ -3, -3 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write negative number');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write negative number');
+
+
+	/* Write fractional values */
+	buf = new Buffer(12);
+	data = [ 3.33, 0 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ 0, 3.3 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	data = [ 3.33, 2.42 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write fractions');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write fractions');
+
+	/* Write values that are too large */
+	buf = new Buffer(12);
+	data = [ 0xffffffffff, 23 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ 0xffffffffff, 0xffffff238 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+
+	data = [ 0x23, 0xffffff238 ];
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'big', buf, 1);
+	}, Error, 'write too large');
+	ASSERT.throws(function () {
+	    mod_ctype.wuint64(data, 'little', buf, 1);
+	}, Error, 'write too large');
+}
+
+
+testRead();
+testReadOver();
+testWriteZero();
+testWrite();
+testWriteInvalid();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.roundtrip.js	(revision 487)
@@ -0,0 +1,81 @@
+/*
+ * A battery of tests for sucessful round-trip between writes and reads
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+
+/*
+ * What the heck, let's just test every value for 8-bits.
+ */
+
+function test8() {
+	var data = new Buffer(1);
+	var i;
+	for (i = 0; i < 256; i++) {
+		mod_ctype.wuint8(i, 'big', data, 0);
+		ASSERT.equal(i, mod_ctype.ruint8(data, 'big', 0));
+		mod_ctype.wuint8(i, 'little', data, 0);
+		ASSERT.equal(i, mod_ctype.ruint8(data, 'little', 0));
+	}
+	ASSERT.ok(true);
+}
+
+/*
+ * Test a random sample of 256 values in the 16-bit unsigned range
+ */
+
+function test16() {
+	var data = new Buffer(2);
+	var i = 0;
+	for (i = 0; i < 256; i++) {
+		var value = Math.round(Math.random() * Math.pow(2, 16));
+		mod_ctype.wuint16(value, 'big', data, 0);
+		ASSERT.equal(value, mod_ctype.ruint16(data, 'big', 0));
+		mod_ctype.wuint16(value, 'little', data, 0);
+		ASSERT.equal(value, mod_ctype.ruint16(data, 'little', 0));
+	}
+}
+
+/*
+ * Test a random sample of 256 values in the 32-bit unsigned range
+ */
+
+function test32() {
+	var data = new Buffer(4);
+	var i = 0;
+	for (i = 0; i < 256; i++) {
+		var value = Math.round(Math.random() * Math.pow(2, 32));
+		mod_ctype.wuint32(value, 'big', data, 0);
+		ASSERT.equal(value, mod_ctype.ruint32(data, 'big', 0));
+		mod_ctype.wuint32(value, 'little', data, 0);
+		ASSERT.equal(value, mod_ctype.ruint32(data, 'little', 0));
+	}
+}
+
+/*
+ * Test a random sample of 256 values in the 64-bit unsigned range
+ */
+
+function test64() {
+	var data = new Buffer(8);
+	var i = 0;
+	for (i = 0; i < 256; i++) {
+		var low = Math.round(Math.random() * Math.pow(2, 32));
+		var high = Math.round(Math.random() * Math.pow(2, 32));
+		mod_ctype.wuint64([high, low], 'big', data, 0);
+		var result = mod_ctype.ruint64(data, 'big', 0);
+		ASSERT.equal(high, result[0]);
+		ASSERT.equal(low, result[1]);
+		mod_ctype.wuint64([high, low], 'little', data, 0);
+		result = mod_ctype.ruint64(data, 'little', 0);
+		ASSERT.equal(high, result[0]);
+		ASSERT.equal(low, result[1]);
+	}
+}
+
+exports.test8 = test8;
+exports.test16 = test16;
+exports.test32 = test32;
+exports.test64 = test64;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.ruint.js	(revision 487)
@@ -0,0 +1,95 @@
+/*
+ * A battery of tests to help us read a series of uints
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+/*
+ * We need to check the following things:
+ *  - We are correctly resolving big endian (doesn't mean anything for 8 bit)
+ *  - Correctly resolving little endian (doesn't mean anything for 8 bit)
+ *  - Correctly using the offsets
+ *  - Correctly interpreting values that are beyond the signed range as unsigned
+ */
+function test8()
+{
+	var data = new Buffer(4);
+	data[0] = 23;
+	data[1] = 23;
+	data[2] = 23;
+	data[3] = 23;
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 0));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 0));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 1));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 1));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 2));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 2));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'big', 3));
+	ASSERT.equal(23, mod_ctype.ruint8(data, 'little', 3));
+	data[0] = 255; /* If it became a signed int, would be -1 */
+	ASSERT.equal(255, mod_ctype.ruint8(data, 'big', 0));
+	ASSERT.equal(255, mod_ctype.ruint8(data, 'little', 0));
+}
+
+/*
+ * Test 16 bit unsigned integers. We need to verify the same set as 8 bit, only
+ * now some of the issues actually matter:
+ *  - We are correctly resolving big endian
+ *  - Correctly resolving little endian
+ *  - Correctly using the offsets
+ *  - Correctly interpreting values that are beyond the signed range as unsigned
+ */
+function test16()
+{
+	var data = new Buffer(4);
+	/* Test signed values first */
+	data[0] = 0;
+	data[1] = 0x23;
+	data[2] = 0x42;
+	data[3] = 0x3f;
+
+	ASSERT.equal(0x23, mod_ctype.ruint16(data, 'big', 0));
+	ASSERT.equal(0x2342, mod_ctype.ruint16(data, 'big', 1));
+	ASSERT.equal(0x423f, mod_ctype.ruint16(data, 'big', 2));
+
+	ASSERT.equal(0x2300, mod_ctype.ruint16(data, 'little', 0));
+	ASSERT.equal(0x4223, mod_ctype.ruint16(data, 'little', 1));
+	ASSERT.equal(0x3f42, mod_ctype.ruint16(data, 'little', 2));
+
+	data[0] = 0xfe;
+	data[1] = 0xfe;
+
+	ASSERT.equal(0xfefe, mod_ctype.ruint16(data, 'big', 0));
+	ASSERT.equal(0xfefe, mod_ctype.ruint16(data, 'little', 0));
+}
+
+/*
+ * Test 32 bit unsigned integers. We need to verify the same set as 8 bit, only
+ * now some of the issues actually matter:
+ *  - We are correctly resolving big endian
+ *  - Correctly using the offsets
+ *  - Correctly interpreting values that are beyond the signed range as unsigned
+ */
+function test32()
+{
+	var data = new Buffer(8);
+	data[0] = 0x32;
+	data[1] = 0x65;
+	data[2] = 0x42;
+	data[3] = 0x56;
+	data[4] = 0x23;
+	data[5] = 0xff;
+
+	ASSERT.equal(0x32654256, mod_ctype.ruint32(data, 'big', 0));
+	ASSERT.equal(0x65425623, mod_ctype.ruint32(data, 'big', 1));
+	ASSERT.equal(0x425623ff, mod_ctype.ruint32(data, 'big', 2));
+
+	ASSERT.equal(0x56426532, mod_ctype.ruint32(data, 'little', 0));
+	ASSERT.equal(0x23564265, mod_ctype.ruint32(data, 'little', 1));
+	ASSERT.equal(0xff235642, mod_ctype.ruint32(data, 'little', 2));
+}
+
+test8();
+test16();
+test32();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctio/uint/tst.wuint.js	(revision 487)
@@ -0,0 +1,156 @@
+/*
+ * A battery of tests to help us read a series of uints
+ */
+
+var mod_ctype = require('../../../ctio.js');
+var ASSERT = require('assert');
+
+/*
+ * We need to check the following things:
+ *  - We are correctly resolving big endian (doesn't mean anything for 8 bit)
+ *  - Correctly resolving little endian (doesn't mean anything for 8 bit)
+ *  - Correctly using the offsets
+ *  - Correctly interpreting values that are beyond the signed range as unsigned
+ */
+function test8()
+{
+	var data = new Buffer(4);
+	mod_ctype.wuint8(23, 'big', data, 0);
+	mod_ctype.wuint8(23, 'big', data, 1);
+	mod_ctype.wuint8(23, 'big', data, 2);
+	mod_ctype.wuint8(23, 'big', data, 3);
+	ASSERT.equal(23, data[0]);
+	ASSERT.equal(23, data[1]);
+	ASSERT.equal(23, data[2]);
+	ASSERT.equal(23, data[3]);
+	mod_ctype.wuint8(23, 'little', data, 0);
+	mod_ctype.wuint8(23, 'little', data, 1);
+	mod_ctype.wuint8(23, 'little', data, 2);
+	mod_ctype.wuint8(23, 'little', data, 3);
+	ASSERT.equal(23, data[0]);
+	ASSERT.equal(23, data[1]);
+	ASSERT.equal(23, data[2]);
+	ASSERT.equal(23, data[3]);
+	mod_ctype.wuint8(255, 'big', data, 0);
+	ASSERT.equal(255, data[0]);
+	mod_ctype.wuint8(255, 'little', data, 0);
+	ASSERT.equal(255, data[0]);
+}
+
+function test16()
+{
+	var value = 0x2343;
+	var data = new Buffer(4);
+	mod_ctype.wuint16(value, 'big', data, 0);
+	ASSERT.equal(0x23, data[0]);
+	ASSERT.equal(0x43, data[1]);
+	mod_ctype.wuint16(value, 'big', data, 1);
+	ASSERT.equal(0x23, data[1]);
+	ASSERT.equal(0x43, data[2]);
+	mod_ctype.wuint16(value, 'big', data, 2);
+	ASSERT.equal(0x23, data[2]);
+	ASSERT.equal(0x43, data[3]);
+
+	mod_ctype.wuint16(value, 'little', data, 0);
+	ASSERT.equal(0x23, data[1]);
+	ASSERT.equal(0x43, data[0]);
+
+	mod_ctype.wuint16(value, 'little', data, 1);
+	ASSERT.equal(0x23, data[2]);
+	ASSERT.equal(0x43, data[1]);
+
+	mod_ctype.wuint16(value, 'little', data, 2);
+	ASSERT.equal(0x23, data[3]);
+	ASSERT.equal(0x43, data[2]);
+
+	value = 0xff80;
+	mod_ctype.wuint16(value, 'little', data, 0);
+	ASSERT.equal(0xff, data[1]);
+	ASSERT.equal(0x80, data[0]);
+
+	mod_ctype.wuint16(value, 'big', data, 0);
+	ASSERT.equal(0xff, data[0]);
+	ASSERT.equal(0x80, data[1]);
+}
+
+function test32()
+{
+	var data = new Buffer(6);
+	var value = 0xe7f90a6d;
+
+	mod_ctype.wuint32(value, 'big', data, 0);
+	ASSERT.equal(0xe7, data[0]);
+	ASSERT.equal(0xf9, data[1]);
+	ASSERT.equal(0x0a, data[2]);
+	ASSERT.equal(0x6d, data[3]);
+
+	mod_ctype.wuint32(value, 'big', data, 1);
+	ASSERT.equal(0xe7, data[1]);
+	ASSERT.equal(0xf9, data[2]);
+	ASSERT.equal(0x0a, data[3]);
+	ASSERT.equal(0x6d, data[4]);
+
+	mod_ctype.wuint32(value, 'big', data, 2);
+	ASSERT.equal(0xe7, data[2]);
+	ASSERT.equal(0xf9, data[3]);
+	ASSERT.equal(0x0a, data[4]);
+	ASSERT.equal(0x6d, data[5]);
+
+	mod_ctype.wuint32(value, 'little', data, 0);
+	ASSERT.equal(0xe7, data[3]);
+	ASSERT.equal(0xf9, data[2]);
+	ASSERT.equal(0x0a, data[1]);
+	ASSERT.equal(0x6d, data[0]);
+
+	mod_ctype.wuint32(value, 'little', data, 1);
+	ASSERT.equal(0xe7, data[4]);
+	ASSERT.equal(0xf9, data[3]);
+	ASSERT.equal(0x0a, data[2]);
+	ASSERT.equal(0x6d, data[1]);
+
+	mod_ctype.wuint32(value, 'little', data, 2);
+	ASSERT.equal(0xe7, data[5]);
+	ASSERT.equal(0xf9, data[4]);
+	ASSERT.equal(0x0a, data[3]);
+	ASSERT.equal(0x6d, data[2]);
+}
+
+function test64()
+{
+	var data = new Buffer(10);
+	var value = 0x0007cda8e7f90a6d;
+	var high = Math.floor(value / Math.pow(2, 32));
+	var low = value - (high * Math.pow(2, 32));
+	ASSERT.equal(0x0007cda8, high);
+	ASSERT.equal(0xe7f90a6d, low);
+
+	mod_ctype.wuint64([high, low], 'big', data, 0);
+	ASSERT.equal(0x00, data[0]);
+	ASSERT.equal(0x07, data[1]);
+	ASSERT.equal(0xcd, data[2]);
+	ASSERT.equal(0xa8, data[3]);
+	ASSERT.equal(0xe7, data[4]);
+	ASSERT.equal(0xf9, data[5]);
+	ASSERT.equal(0x0a, data[6]);
+	ASSERT.equal(0x6d, data[7]);
+
+	mod_ctype.wuint64([high, low], 'little', data, 0);
+	ASSERT.equal(0x6d, data[0]);
+	ASSERT.equal(0x0a, data[1]);
+	ASSERT.equal(0xf9, data[2]);
+	ASSERT.equal(0xe7, data[3]);
+	ASSERT.equal(0xa8, data[4]);
+	ASSERT.equal(0xcd, data[5]);
+	ASSERT.equal(0x07, data[6]);
+	ASSERT.equal(0x00, data[7]);
+}
+
+test8();
+test16();
+test32();
+test64();
+
+exports.test8 = test8;
+exports.test16 = test16;
+exports.test32 = test32;
+exports.test64 = test64;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicr.js	(revision 487)
@@ -0,0 +1,50 @@
+/*
+ * Simple does to see if it works at all
+ */
+var mod_ctype = require('../../ctype');
+var ASSERT = require('assert');
+var mod_sys = require('sys');
+
+function test()
+{
+	var ii, p, result, buffer;
+
+	p = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer(4);
+	buffer[0] = 23;
+	buffer[3] = 42;
+	result = p.readData([ { x: { type: 'uint8_t' }},
+	    { y: { type: 'uint8_t', offset: 3 }}
+	], buffer, 0);
+	ASSERT.equal(23, result['x']);
+	ASSERT.equal(42, result['y']);
+
+	buffer = new Buffer(23);
+	for (ii = 0; ii < 23; ii++)
+		buffer[ii] = 0;
+
+	buffer.write('Hello, world!');
+	result = p.readData([ { x: { type: 'char[20]' }} ], buffer, 0);
+
+	/*
+	 * This is currently broken behvaior, need to redesign check
+	 * ASSERT.equal('Hello, world!', result['x'].toString('utf-8', 0,
+	 *  result['x'].length));
+	 */
+
+	buffer = new Buffer(4);
+	buffer[0] = 0x03;
+	buffer[1] = 0x24;
+	buffer[2] = 0x25;
+	buffer[3] = 0x26;
+	result = p.readData([ { y: { type: 'uint8_t' }},
+	    { x: { type: 'uint8_t[y]' }}], buffer, 0);
+	console.log(mod_sys.inspect(result, true));
+
+	p.typedef('ssize_t', 'int32_t');
+	ASSERT.deepEqual({ 'ssize_t': 'int32_t' }, p.lstypes());
+	result = p.readData([ { x: { type: 'ssize_t' } } ], buffer, 0);
+	ASSERT.equal(0x26252403, result['x']);
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.basicw.js	(revision 487)
@@ -0,0 +1,44 @@
+/*
+ * Simple does it fucking work at all test
+ */
+
+var mod_ctype = require('../../ctype');
+var ASSERT = require('assert');
+var mod_sys = require('sys');
+
+function test()
+{
+	var ii, p, buffer, buf2;
+
+	p = new mod_ctype.Parser({ endian: 'big' });
+	buffer = new Buffer(4);
+	p.writeData([ { x: { type: 'uint8_t', value: 23 }},
+	    { y: { type: 'uint8_t', offset: 3, value: 42 }}
+	], buffer, 0);
+	ASSERT.equal(23, buffer[0]);
+	ASSERT.equal(42, buffer[3]);
+
+	buffer = new Buffer(20);
+	for (ii = 0; ii < 20; ii++)
+		buffer[ii] = 0;
+
+	buffer.write('Hello, world!');
+	buf2 = new Buffer(22);
+	p.writeData([ { x: { type: 'char[20]', value: buffer }} ], buf2, 0);
+	for (ii = 0; ii < 20; ii++)
+		ASSERT.equal(buffer[ii], buf2[ii]);
+	/*
+	 * This is currently broken behvaior, need to redesign check
+	 * ASSERT.equal('Hello, world!', result['x'].toString('utf-8', 0,
+	 *   result['x'].length));
+	 */
+
+	buffer = new Buffer(4);
+	p.writeData([ { y: { type: 'uint8_t', value: 3 }},
+	    { x: { type: 'uint8_t[y]', value: [ 0x24, 0x25, 0x26] }}],
+	    buffer, 0);
+	console.log(mod_sys.inspect(buffer));
+
+	p.typedef('ssize_t', 'int32_t');
+	ASSERT.deepEqual({ 'ssize_t': 'int32_t' }, p.lstypes());
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.char.js	(revision 487)
@@ -0,0 +1,42 @@
+/*
+ * Test the different forms of reading characters:
+ *
+ *  - the default, a single element buffer
+ *  - uint8, values are uint8_ts
+ *  - int8, values are int8_ts
+ */
+var mod_ctype = require('../../ctype');
+var mod_assert = require('assert');
+
+function test()
+{
+	var p, buf, res;
+
+	buf = new Buffer(1);
+	buf[0] = 255;
+
+	p = new mod_ctype.Parser({ endian: 'little'});
+	res = p.readData([ { c: { type: 'char' }} ], buf, 0);
+	res = res['c'];
+	mod_assert.ok(res instanceof Buffer);
+	mod_assert.equal(255, res[0]);
+
+	p = new mod_ctype.Parser({ endian: 'little',
+	    'char-type': 'int8' });
+	res = p.readData([ { c: { type: 'char' }} ], buf, 0);
+	res = res['c'];
+	mod_assert.ok(typeof (res) == 'number', 'got typeof (res): ' +
+	    typeof (res));
+	mod_assert.equal(-1, res);
+
+	p = new mod_ctype.Parser({ endian: 'little',
+	    'char-type': 'uint8' });
+	res = p.readData([ { c: { type: 'char' }} ], buf, 0);
+	res = res['c'];
+	mod_assert.ok(typeof (res) == 'number', 'got typeof (res): ' +
+	    typeof (res));
+	mod_assert.equal(255, res);
+
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.endian.js	(revision 487)
@@ -0,0 +1,45 @@
+/*
+ * Simple test to make sure that the endian setting works.
+ */
+
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var parser, buf;
+
+	parser = new mod_ctype.Parser({
+	    endian: 'little'
+	});
+
+	buf = new Buffer(2);
+	parser.writeData([ { key: { type: 'uint16_t' } } ], buf, 0, [ 0x1234 ]);
+	mod_assert.equal(buf[0], 0x34);
+	mod_assert.equal(buf[1], 0x12);
+	parser.setEndian('big');
+
+	parser.writeData([ { key: { type: 'uint16_t' } } ], buf, 0, [ 0x1234 ]);
+	mod_assert.equal(buf[0], 0x12);
+	mod_assert.equal(buf[1], 0x34);
+
+	parser.setEndian('little');
+	parser.writeData([ { key: { type: 'uint16_t' } } ], buf, 0, [ 0x1234 ]);
+	mod_assert.equal(buf[0], 0x34);
+	mod_assert.equal(buf[1], 0x12);
+}
+
+function fail()
+{
+	var parser;
+
+	parser = new mod_ctype.Parser({
+	    endian: 'little'
+	});
+	mod_assert.throws(function () {
+		parser.setEndian('littlebigwrong');
+	});
+}
+
+test();
+fail();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.oldwrite.js	(revision 487)
@@ -0,0 +1,28 @@
+/*
+ * A long overdue test to go through and verify that we can read and write
+ * structures as well as nested structures.
+ */
+
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var parser, buf, data;
+	parser = new mod_ctype.Parser({
+	    endian: 'little'
+	});
+	parser.typedef('point_t', [
+	    { x: { type: 'uint8_t' } },
+	    { y: { type: 'uint8_t' } }
+	]);
+	buf = new Buffer(2);
+	data = [
+	    { point: { type: 'point_t', value: [ 23, 42 ] } }
+	];
+	parser.writeData(data, buf, 0);
+	mod_assert.ok(buf[0] == 23);
+	mod_assert.ok(buf[1] == 42);
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.readSize.js	(revision 487)
@@ -0,0 +1,128 @@
+/*
+ * Testing to ensure we're reading the expected number bytes
+ */
+var mod_ctype = require('../../ctype');
+var ASSERT = require('assert');
+
+function testUint8()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('80', 'hex');
+	result = parser.readStruct([ { item: { type: 'uint8_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 1);
+}
+
+function testSint8()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('80', 'hex');
+	result = parser.readStruct([ { item: { type: 'int8_t' } } ], buffer, 0);
+	ASSERT.equal(result['size'], 1);
+}
+
+function testUint16()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('8000', 'hex');
+	result = parser.readStruct([ { item: { type: 'uint16_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 2);
+}
+
+function testSint16()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('8000', 'hex');
+	result = parser.readStruct([ { item: { type: 'int16_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 2);
+}
+
+function testUint32()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('80000000', 'hex');
+	result = parser.readStruct([ { item: { type: 'uint32_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 4);
+}
+
+function testSint32()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('80000000', 'hex');
+	result = parser.readStruct([ { item: { type: 'int32_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 4);
+}
+
+function testUint64()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('8000000000000000', 'hex');
+	result = parser.readStruct([ { item: { type: 'uint64_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 8);
+}
+
+function testSint64()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('8000000000000000', 'hex');
+	result = parser.readStruct([ { item: { type: 'int64_t' } } ], buffer,
+	    0);
+	ASSERT.equal(result['size'], 8);
+}
+
+function testFloat()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('ABAAAA3E', 'hex');
+	result = parser.readStruct([ { item: { type: 'float' } } ], buffer, 0);
+	ASSERT.equal(result['size'], 4);
+}
+
+function testDouble()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('000000000000F03F', 'hex');
+	result = parser.readStruct([ { item: { type: 'double' } } ], buffer, 0);
+	ASSERT.equal(result['size'], 8);
+}
+
+function testChar()
+{
+	var parser, result, buffer;
+	parser = new mod_ctype.Parser({ endian: 'little' });
+	buffer = new Buffer('t');
+	result = parser.readStruct([ { item: { type: 'char' } } ], buffer, 0);
+	ASSERT.equal(result['size'], 1);
+}
+
+function test()
+{
+	testSint8();
+	testUint8();
+	testSint16();
+	testUint16();
+	testSint32();
+	testUint32();
+	testSint64();
+	testUint64();
+	testFloat();
+	testDouble();
+	testChar();
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.structw.js	(revision 487)
@@ -0,0 +1,28 @@
+/*
+ * A long overdue test to go through and verify that we can read and write
+ * structures as well as nested structures.
+ */
+
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var parser, buf, data;
+	parser = new mod_ctype.Parser({
+	    endian: 'little'
+	});
+	parser.typedef('point_t', [
+	    { x: { type: 'uint8_t' } },
+	    { y: { type: 'uint8_t' } }
+	]);
+	buf = new Buffer(2);
+	data = [
+	    { point: { type: 'point_t' } }
+	];
+	parser.writeData(data, buf, 0, [ [ 23, 42 ] ]);
+	mod_assert.ok(buf[0] == 23);
+	mod_assert.ok(buf[1] == 42);
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/node_modules/ctype/tst/ctype/tst.writeStruct.js	(revision 487)
@@ -0,0 +1,31 @@
+/*
+ * Test to verify that the offset is incremented when structures are written to.
+ * Hopefully we will not regress issue #41
+ */
+
+var mod_ctype = require('../../ctype.js');
+var mod_assert = require('assert');
+
+function test()
+{
+	var parser, buf, data;
+	parser = new mod_ctype.Parser({
+	    endian: 'little'
+	});
+	parser.typedef('point_t', [
+	    { x: { type: 'uint8_t' } },
+	    { y: { type: 'uint8_t' } }
+	]);
+	buf = new Buffer(4);
+	data = [
+	    { point1: { type: 'point_t' } },
+	    { point2: { type: 'point_t' } }
+	];
+	parser.writeData(data, buf, 0, [ [ 23, 42 ], [ 91, 18 ] ]);
+	mod_assert.ok(buf[0] == 23);
+	mod_assert.ok(buf[1] == 42);
+	mod_assert.ok(buf[2] == 91);
+	mod_assert.ok(buf[3] == 18);
+}
+
+test();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/http-signature/package.json	(revision 487)
@@ -0,0 +1,36 @@
+{
+  "author": {
+    "name": "Joyent, Inc"
+  },
+  "name": "http-signature",
+  "description": "Reference implementation of Joyent's HTTP Signature Scheme",
+  "version": "0.10.0",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/joyent/node-http-signature.git"
+  },
+  "engines": {
+    "node": ">=0.8"
+  },
+  "main": "lib/index.js",
+  "scripts": {
+    "test": "tap tst/*.js"
+  },
+  "dependencies": {
+    "assert-plus": "0.1.2",
+    "asn1": "0.1.11",
+    "ctype": "0.5.2"
+  },
+  "devDependencies": {
+    "node-uuid": "1.4.0",
+    "tap": "0.4.2"
+  },
+  "readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actaully want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n    var fs = require('fs');\n    var https = require('https');\n    var httpSignature = require('http-signature');\n\n    var key = fs.readFileSync('./key.pem', 'ascii');\n\n    var options = {\n      host: 'localhost',\n      port: 8443,\n      path: '/',\n      method: 'GET',\n      headers: {}\n    };\n\n    // Adds a 'Date' header in, signs it, and adds the\n    // 'Authorization' header in.\n    var req = https.request(options, function(res) {\n      console.log(res.statusCode);\n    });\n\n\n    httpSignature.sign(req, {\n      key: key,\n      keyId: './cert.pem'\n    });\n\n    req.end();\n\n### Server\n\n    var fs = require('fs');\n    var https = require('https');\n    var httpSignature = require('http-signature');\n\n    var options = {\n      key: fs.readFileSync('./key.pem'),\n      cert: fs.readFileSync('./cert.pem')\n    };\n\n    https.createServer(options, function (req, res) {\n      var rc = 200;\n      var parsed = httpSignature.parseRequest(req);\n      var pub = fs.readFileSync(parsed.keyId, 'ascii');\n      if (!httpSignature.verifySignature(parsed, pub))\n        rc = 401;\n\n      res.writeHead(rc);\n      res.end();\n    }).listen(8443);\n\n## Installation\n\n    npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/joyent/node-http-signature/issues"
+  },
+  "homepage": "https://github.com/joyent/node-http-signature",
+  "_id": "http-signature@0.10.0",
+  "_from": "http-signature@~0.10.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/LICENSE	(revision 487)
@@ -0,0 +1,27 @@
+Copyright (c) Isaac Z. Schlueter ("Author")
+All rights reserved.
+
+The BSD License
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/README.md	(revision 487)
@@ -0,0 +1,49 @@
+# json-stringify-safe
+
+Like JSON.stringify, but doesn't throw on circular references.
+
+## Usage
+
+Takes the same arguments as `JSON.stringify`.
+
+```javascript
+var stringify = require('json-stringify-safe');
+var circularObj = {};
+circularObj.circularRef = circularObj;
+circularObj.list = [ circularObj, circularObj ];
+console.log(stringify(circularObj, null, 2));
+```
+
+Output:
+
+```json
+{
+  "circularRef": "[Circular]",
+  "list": [
+    "[Circular]",
+    "[Circular]"
+  ]
+}
+```
+
+## Details
+
+```
+stringify(obj, serializer, indent, decycler)
+```
+
+The first three arguments are the same as to JSON.stringify.  The last
+is an argument that's only used when the object has been seen already.
+
+The default `decycler` function returns the string `'[Circular]'`.
+If, for example, you pass in `function(k,v){}` (return nothing) then it
+will prune cycles.  If you pass in `function(k,v){ return {foo: 'bar'}}`,
+then cyclical objects will always be represented as `{"foo":"bar"}` in
+the result.
+
+```
+stringify.getSerialize(serializer, decycler)
+```
+
+Returns a serializer that can be used elsewhere.  This is the actual
+function that's passed to JSON.stringify.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/package.json	(revision 487)
@@ -0,0 +1,33 @@
+{
+  "name": "json-stringify-safe",
+  "version": "5.0.0",
+  "description": "Like JSON.stringify, but doesn't blow up on circular refs",
+  "main": "stringify.js",
+  "scripts": {
+    "test": "node test.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/json-stringify-safe"
+  },
+  "keywords": [
+    "json",
+    "stringify",
+    "circular",
+    "safe"
+  ],
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me"
+  },
+  "license": "BSD",
+  "readmeFilename": "README.md",
+  "readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n  \"circularRef\": \"[Circular]\",\n  \"list\": [\n    \"[Circular]\",\n    \"[Circular]\"\n  ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify.  The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles.  If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere.  This is the actual\nfunction that's passed to JSON.stringify.\n",
+  "bugs": {
+    "url": "https://github.com/isaacs/json-stringify-safe/issues"
+  },
+  "homepage": "https://github.com/isaacs/json-stringify-safe",
+  "_id": "json-stringify-safe@5.0.0",
+  "_from": "json-stringify-safe@~5.0.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/stringify.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/stringify.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/stringify.js	(revision 487)
@@ -0,0 +1,39 @@
+module.exports = stringify;
+
+function getSerialize (fn, decycle) {
+  var seen = [], keys = [];
+  decycle = decycle || function(key, value) {
+    return '[Circular ' + getPath(value, seen, keys) + ']'
+  };
+  return function(key, value) {
+    var ret = value;
+    if (typeof value === 'object' && value) {
+      if (seen.indexOf(value) !== -1)
+        ret = decycle(key, value);
+      else {
+        seen.push(value);
+        keys.push(key);
+      }
+    }
+    if (fn) ret = fn(key, ret);
+    return ret;
+  }
+}
+
+function getPath (value, seen, keys) {
+  var index = seen.indexOf(value);
+  var path = [ keys[index] ];
+  for (index--; index >= 0; index--) {
+    if (seen[index][ path[0] ] === value) {
+      value = seen[index];
+      path.unshift(keys[index]);
+    }
+  }
+  return '~' + path.join('.');
+}
+
+function stringify(obj, fn, spaces, decycle) {
+  return JSON.stringify(obj, getSerialize(fn, decycle), spaces);
+}
+
+stringify.getSerialize = getSerialize;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/test.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/test.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/json-stringify-safe/test.js	(revision 487)
@@ -0,0 +1,128 @@
+var stringify = require('./stringify.js');
+
+var circularObj = { a: 'b' };
+circularObj.circularRef = circularObj;
+circularObj.list = [ circularObj, circularObj ];
+
+//////////
+// default
+var testObj = {
+  "a": "b",
+  "circularRef": "[Circular ~]",
+  "list": [
+    "[Circular ~]",
+    "[Circular ~]"
+  ]
+};
+
+var assert = require('assert');
+assert.equal(JSON.stringify(testObj, null, 2),
+             stringify(circularObj, null, 2));
+
+assert.equal(JSON.stringify(testObj, null, 2),
+            JSON.stringify(circularObj, stringify.getSerialize(), 2));
+
+
+////////
+// prune
+testObj = {
+  "a": "b",
+  "list": [
+    null,
+    null
+  ]
+};
+
+function prune(k, v) {}
+
+assert.equal(JSON.stringify(testObj, null, 2),
+             stringify(circularObj, null, 2, prune));
+
+///////////
+// re-cycle
+// (throws)
+function recycle(k, v) {
+  return v;
+}
+
+assert.throws(function() {
+  stringify(circularObj, null, 2, recycle);
+});
+
+////////
+// fancy
+testObj = {
+  "a": "b",
+  "circularRef": "circularRef{a:string,circularRef:Object,list:Array}",
+  "list": [
+    "0{a:string,circularRef:Object,list:Array}",
+    "1{a:string,circularRef:Object,list:Array}"
+  ]
+};
+
+function signer(key, value) {
+  var ret = key + '{';
+  var f = false;
+  for (var i in value) {
+    if (f)
+      ret += ',';
+    f = true;
+    ret += i + ':';
+    var v = value[i];
+    switch (typeof v) {
+      case 'object':
+        if (!v)
+          ret += 'null';
+        else if (Array.isArray(v))
+          ret += 'Array'
+        else
+          ret += v.constructor && v.constructor.name || 'Object';
+        break;
+      default:
+        ret += typeof v;
+        break;
+    }
+  }
+  ret += '}';
+  return ret;
+}
+
+assert.equal(JSON.stringify(testObj, null, 2),
+             stringify(circularObj, null, 2, signer));
+
+
+///////
+//multi
+var a = { x: 1 };
+a.a = a;
+var b = { x: 2 };
+b.a = a;
+
+var c = { a: a, b: b };
+var d = { list: [ a, b, c ] };
+d.d = d;
+
+var multi = {
+  "list": [
+    {
+      "x": 1,
+      "a": "[Circular ~.list.0]"
+    },
+    {
+      "x": 2,
+      "a": "[Circular ~.list.0]"
+    },
+    {
+      "a": "[Circular ~.list.0]",
+      "b": "[Circular ~.list.1]"
+    }
+  ],
+  "d": "[Circular ~]"
+};
+
+assert.equal(JSON.stringify(multi, null, 2),
+             stringify(d, null, 2));
+
+////////
+// pass!
+console.log('ok');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/LICENSE	(revision 487)
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Benjamin Thomas, Robert Kieffer
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/README.md	(revision 487)
@@ -0,0 +1,66 @@
+# mime
+
+Comprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.
+
+## Install
+
+Install with [npm](http://github.com/isaacs/npm):
+
+    npm install mime
+
+## API - Queries
+
+### mime.lookup(path)
+Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.
+
+    var mime = require('mime');
+
+    mime.lookup('/path/to/file.txt');         // => 'text/plain'
+    mime.lookup('file.txt');                  // => 'text/plain'
+    mime.lookup('.TXT');                      // => 'text/plain'
+    mime.lookup('htm');                       // => 'text/html'
+
+### mime.default_type
+Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)
+
+### mime.extension(type)
+Get the default extension for `type`
+
+    mime.extension('text/html');                 // => 'html'
+    mime.extension('application/octet-stream');  // => 'bin'
+
+### mime.charsets.lookup()
+
+Map mime-type to charset
+
+    mime.charsets.lookup('text/plain');        // => 'UTF-8'
+
+(The logic for charset lookups is pretty rudimentary.  Feel free to suggest improvements.)
+
+## API - Defining Custom Types
+
+The following APIs allow you to add your own type mappings within your project.  If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).
+
+### mime.define()
+
+Add custom mime/extension mappings
+
+    mime.define({
+        'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],
+        'application/x-my-type': ['x-mt', 'x-mtt'],
+        // etc ...
+    });
+
+    mime.lookup('x-sft');                 // => 'text/x-some-format'
+
+The first entry in the extensions array is returned by `mime.extension()`. E.g.
+
+    mime.extension('text/x-some-format'); // => 'x-sf'
+
+### mime.load(filepath)
+
+Load mappings from an Apache ".types" format file
+
+    mime.load('./my_project.types');
+
+The .types file format is simple -  See the `types` dir for examples.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/mime.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/mime.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/mime.js	(revision 487)
@@ -0,0 +1,114 @@
+var path = require('path');
+var fs = require('fs');
+
+function Mime() {
+  // Map of extension -> mime type
+  this.types = Object.create(null);
+
+  // Map of mime type -> extension
+  this.extensions = Object.create(null);
+}
+
+/**
+ * Define mimetype -> extension mappings.  Each key is a mime-type that maps
+ * to an array of extensions associated with the type.  The first extension is
+ * used as the default extension for the type.
+ *
+ * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']});
+ *
+ * @param map (Object) type definitions
+ */
+Mime.prototype.define = function (map) {
+  for (var type in map) {
+    var exts = map[type];
+
+    for (var i = 0; i < exts.length; i++) {
+      if (process.env.DEBUG_MIME && this.types[exts]) {
+        console.warn(this._loading.replace(/.*\//, ''), 'changes "' + exts[i] + '" extension type from ' +
+          this.types[exts] + ' to ' + type);
+      }
+
+      this.types[exts[i]] = type;
+    }
+
+    // Default extension is the first one we encounter
+    if (!this.extensions[type]) {
+      this.extensions[type] = exts[0];
+    }
+  }
+};
+
+/**
+ * Load an Apache2-style ".types" file
+ *
+ * This may be called multiple times (it's expected).  Where files declare
+ * overlapping types/extensions, the last file wins.
+ *
+ * @param file (String) path of file to load.
+ */
+Mime.prototype.load = function(file) {
+
+  this._loading = file;
+  // Read file and split into lines
+  var map = {},
+      content = fs.readFileSync(file, 'ascii'),
+      lines = content.split(/[\r\n]+/);
+
+  lines.forEach(function(line) {
+    // Clean up whitespace/comments, and split into fields
+    var fields = line.replace(/\s*#.*|^\s*|\s*$/g, '').split(/\s+/);
+    map[fields.shift()] = fields;
+  });
+
+  this.define(map);
+
+  this._loading = null;
+};
+
+/**
+ * Lookup a mime type based on extension
+ */
+Mime.prototype.lookup = function(path, fallback) {
+  var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase();
+
+  return this.types[ext] || fallback || this.default_type;
+};
+
+/**
+ * Return file extension associated with a mime type
+ */
+Mime.prototype.extension = function(mimeType) {
+  var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
+  return this.extensions[type];
+};
+
+// Default instance
+var mime = new Mime();
+
+// Load local copy of
+// http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
+mime.load(path.join(__dirname, 'types/mime.types'));
+
+// Load additional types from node.js community
+mime.load(path.join(__dirname, 'types/node.types'));
+
+// Default type
+mime.default_type = mime.lookup('bin');
+
+//
+// Additional API specific to the default instance
+//
+
+mime.Mime = Mime;
+
+/**
+ * Lookup a charset based on mime type.
+ */
+mime.charsets = {
+  lookup: function(mimeType, fallback) {
+    // Assume text types are utf8
+    return (/^text\//).test(mimeType) ? 'UTF-8' : fallback;
+  }
+};
+
+module.exports = mime;
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/package.json	(revision 487)
@@ -0,0 +1,36 @@
+{
+  "author": {
+    "name": "Robert Kieffer",
+    "email": "robert@broofa.com",
+    "url": "http://github.com/broofa"
+  },
+  "contributors": [
+    {
+      "name": "Benjamin Thomas",
+      "email": "benjamin@benjaminthomas.org",
+      "url": "http://github.com/bentomas"
+    }
+  ],
+  "dependencies": {},
+  "description": "A comprehensive library for mime-type mapping",
+  "devDependencies": {},
+  "keywords": [
+    "util",
+    "mime"
+  ],
+  "main": "mime.js",
+  "name": "mime",
+  "repository": {
+    "url": "https://github.com/broofa/node-mime",
+    "type": "git"
+  },
+  "version": "1.2.11",
+  "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n    npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.\n\n    var mime = require('mime');\n\n    mime.lookup('/path/to/file.txt');         // => 'text/plain'\n    mime.lookup('file.txt');                  // => 'text/plain'\n    mime.lookup('.TXT');                      // => 'text/plain'\n    mime.lookup('htm');                       // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n    mime.extension('text/html');                 // => 'html'\n    mime.extension('application/octet-stream');  // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n    mime.charsets.lookup('text/plain');        // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary.  Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project.  If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n    mime.define({\n        'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n        'application/x-my-type': ['x-mt', 'x-mtt'],\n        // etc ...\n    });\n\n    mime.lookup('x-sft');                 // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n    mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n    mime.load('./my_project.types');\n\nThe .types file format is simple -  See the `types` dir for examples.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/broofa/node-mime/issues"
+  },
+  "homepage": "https://github.com/broofa/node-mime",
+  "_id": "mime@1.2.11",
+  "_from": "mime@~1.2.9"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/test.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/test.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/test.js	(revision 487)
@@ -0,0 +1,84 @@
+/**
+ * Usage: node test.js
+ */
+
+var mime = require('./mime');
+var assert = require('assert');
+var path = require('path');
+
+function eq(a, b) {
+  console.log('Test: ' + a + ' === ' + b);
+  assert.strictEqual.apply(null, arguments);
+}
+
+console.log(Object.keys(mime.extensions).length + ' types');
+console.log(Object.keys(mime.types).length + ' extensions\n');
+
+//
+// Test mime lookups
+//
+
+eq('text/plain', mime.lookup('text.txt'));     // normal file
+eq('text/plain', mime.lookup('TEXT.TXT'));     // uppercase
+eq('text/plain', mime.lookup('dir/text.txt')); // dir + file
+eq('text/plain', mime.lookup('.text.txt'));    // hidden file
+eq('text/plain', mime.lookup('.txt'));         // nameless
+eq('text/plain', mime.lookup('txt'));          // extension-only
+eq('text/plain', mime.lookup('/txt'));         // extension-less ()
+eq('text/plain', mime.lookup('\\txt'));        // Windows, extension-less
+eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized
+eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default
+
+//
+// Test extensions
+//
+
+eq('txt', mime.extension(mime.types.text));
+eq('html', mime.extension(mime.types.htm));
+eq('bin', mime.extension('application/octet-stream'));
+eq('bin', mime.extension('application/octet-stream '));
+eq('html', mime.extension(' text/html; charset=UTF-8'));
+eq('html', mime.extension('text/html; charset=UTF-8 '));
+eq('html', mime.extension('text/html; charset=UTF-8'));
+eq('html', mime.extension('text/html ; charset=UTF-8'));
+eq('html', mime.extension('text/html;charset=UTF-8'));
+eq('html', mime.extension('text/Html;charset=UTF-8'));
+eq(undefined, mime.extension('unrecognized'));
+
+//
+// Test node.types lookups
+//
+
+eq('application/font-woff', mime.lookup('file.woff'));
+eq('application/octet-stream', mime.lookup('file.buffer'));
+eq('audio/mp4', mime.lookup('file.m4a'));
+eq('font/opentype', mime.lookup('file.otf'));
+
+//
+// Test charsets
+//
+
+eq('UTF-8', mime.charsets.lookup('text/plain'));
+eq(undefined, mime.charsets.lookup(mime.types.js));
+eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback'));
+
+//
+// Test for overlaps between mime.types and node.types
+//
+
+var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime();
+apacheTypes.load(path.join(__dirname, 'types/mime.types'));
+nodeTypes.load(path.join(__dirname, 'types/node.types'));
+
+var keys = [].concat(Object.keys(apacheTypes.types))
+             .concat(Object.keys(nodeTypes.types));
+keys.sort();
+for (var i = 1; i < keys.length; i++) {
+  if (keys[i] == keys[i-1]) {
+    console.warn('Warning: ' +
+      'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] +
+      ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]);
+  }
+}
+
+console.log('\nOK');
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/types/mime.types
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/types/mime.types	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/types/mime.types	(revision 487)
@@ -0,0 +1,1588 @@
+# This file maps Internet media types to unique file extension(s).
+# Although created for httpd, this file is used by many software systems
+# and has been placed in the public domain for unlimited redisribution.
+#
+# The table below contains both registered and (common) unregistered types.
+# A type that has no unique extension can be ignored -- they are listed
+# here to guide configurations toward known types and to make it easier to
+# identify "new" types.  File extensions are also commonly used to indicate
+# content languages and encodings, so choose them carefully.
+#
+# Internet media types should be registered as described in RFC 4288.
+# The registry is at <http://www.iana.org/assignments/media-types/>.
+#
+# MIME type (lowercased)			Extensions
+# ============================================	==========
+# application/1d-interleaved-parityfec
+# application/3gpp-ims+xml
+# application/activemessage
+application/andrew-inset			ez
+# application/applefile
+application/applixware				aw
+application/atom+xml				atom
+application/atomcat+xml				atomcat
+# application/atomicmail
+application/atomsvc+xml				atomsvc
+# application/auth-policy+xml
+# application/batch-smtp
+# application/beep+xml
+# application/calendar+xml
+# application/cals-1840
+# application/ccmp+xml
+application/ccxml+xml				ccxml
+application/cdmi-capability			cdmia
+application/cdmi-container			cdmic
+application/cdmi-domain				cdmid
+application/cdmi-object				cdmio
+application/cdmi-queue				cdmiq
+# application/cea-2018+xml
+# application/cellml+xml
+# application/cfw
+# application/cnrp+xml
+# application/commonground
+# application/conference-info+xml
+# application/cpl+xml
+# application/csta+xml
+# application/cstadata+xml
+application/cu-seeme				cu
+# application/cybercash
+application/davmount+xml			davmount
+# application/dca-rft
+# application/dec-dx
+# application/dialog-info+xml
+# application/dicom
+# application/dns
+application/docbook+xml				dbk
+# application/dskpp+xml
+application/dssc+der				dssc
+application/dssc+xml				xdssc
+# application/dvcs
+application/ecmascript				ecma
+# application/edi-consent
+# application/edi-x12
+# application/edifact
+application/emma+xml				emma
+# application/epp+xml
+application/epub+zip				epub
+# application/eshop
+# application/example
+application/exi					exi
+# application/fastinfoset
+# application/fastsoap
+# application/fits
+application/font-tdpfr				pfr
+# application/framework-attributes+xml
+application/gml+xml				gml
+application/gpx+xml				gpx
+application/gxf					gxf
+# application/h224
+# application/held+xml
+# application/http
+application/hyperstudio				stk
+# application/ibe-key-request+xml
+# application/ibe-pkg-reply+xml
+# application/ibe-pp-data
+# application/iges
+# application/im-iscomposing+xml
+# application/index
+# application/index.cmd
+# application/index.obj
+# application/index.response
+# application/index.vnd
+application/inkml+xml				ink inkml
+# application/iotp
+application/ipfix				ipfix
+# application/ipp
+# application/isup
+application/java-archive			jar
+application/java-serialized-object		ser
+application/java-vm				class
+application/javascript				js
+application/json				json
+application/jsonml+json				jsonml
+# application/kpml-request+xml
+# application/kpml-response+xml
+application/lost+xml				lostxml
+application/mac-binhex40			hqx
+application/mac-compactpro			cpt
+# application/macwriteii
+application/mads+xml				mads
+application/marc				mrc
+application/marcxml+xml				mrcx
+application/mathematica				ma nb mb
+# application/mathml-content+xml
+# application/mathml-presentation+xml
+application/mathml+xml				mathml
+# application/mbms-associated-procedure-description+xml
+# application/mbms-deregister+xml
+# application/mbms-envelope+xml
+# application/mbms-msk+xml
+# application/mbms-msk-response+xml
+# application/mbms-protection-description+xml
+# application/mbms-reception-report+xml
+# application/mbms-register+xml
+# application/mbms-register-response+xml
+# application/mbms-user-service-description+xml
+application/mbox				mbox
+# application/media_control+xml
+application/mediaservercontrol+xml		mscml
+application/metalink+xml			metalink
+application/metalink4+xml			meta4
+application/mets+xml				mets
+# application/mikey
+application/mods+xml				mods
+# application/moss-keys
+# application/moss-signature
+# application/mosskey-data
+# application/mosskey-request
+application/mp21				m21 mp21
+application/mp4					mp4s
+# application/mpeg4-generic
+# application/mpeg4-iod
+# application/mpeg4-iod-xmt
+# application/msc-ivr+xml
+# application/msc-mixer+xml
+application/msword				doc dot
+application/mxf					mxf
+# application/nasdata
+# application/news-checkgroups
+# application/news-groupinfo
+# application/news-transmission
+# application/nss
+# application/ocsp-request
+# application/ocsp-response
+application/octet-stream	bin dms lrf mar so dist distz pkg bpk dump elc deploy
+application/oda					oda
+application/oebps-package+xml			opf
+application/ogg					ogx
+application/omdoc+xml				omdoc
+application/onenote				onetoc onetoc2 onetmp onepkg
+application/oxps				oxps
+# application/parityfec
+application/patch-ops-error+xml			xer
+application/pdf					pdf
+application/pgp-encrypted			pgp
+# application/pgp-keys
+application/pgp-signature			asc sig
+application/pics-rules				prf
+# application/pidf+xml
+# application/pidf-diff+xml
+application/pkcs10				p10
+application/pkcs7-mime				p7m p7c
+application/pkcs7-signature			p7s
+application/pkcs8				p8
+application/pkix-attr-cert			ac
+application/pkix-cert				cer
+application/pkix-crl				crl
+application/pkix-pkipath			pkipath
+application/pkixcmp				pki
+application/pls+xml				pls
+# application/poc-settings+xml
+application/postscript				ai eps ps
+# application/prs.alvestrand.titrax-sheet
+application/prs.cww				cww
+# application/prs.nprend
+# application/prs.plucker
+# application/prs.rdf-xml-crypt
+# application/prs.xsf+xml
+application/pskc+xml				pskcxml
+# application/qsig
+application/rdf+xml				rdf
+application/reginfo+xml				rif
+application/relax-ng-compact-syntax		rnc
+# application/remote-printing
+application/resource-lists+xml			rl
+application/resource-lists-diff+xml		rld
+# application/riscos
+# application/rlmi+xml
+application/rls-services+xml			rs
+application/rpki-ghostbusters			gbr
+application/rpki-manifest			mft
+application/rpki-roa				roa
+# application/rpki-updown
+application/rsd+xml				rsd
+application/rss+xml				rss
+application/rtf					rtf
+# application/rtx
+# application/samlassertion+xml
+# application/samlmetadata+xml
+application/sbml+xml				sbml
+application/scvp-cv-request			scq
+application/scvp-cv-response			scs
+application/scvp-vp-request			spq
+application/scvp-vp-response			spp
+application/sdp					sdp
+# application/set-payment
+application/set-payment-initiation		setpay
+# application/set-registration
+application/set-registration-initiation		setreg
+# application/sgml
+# application/sgml-open-catalog
+application/shf+xml				shf
+# application/sieve
+# application/simple-filter+xml
+# application/simple-message-summary
+# application/simplesymbolcontainer
+# application/slate
+# application/smil
+application/smil+xml				smi smil
+# application/soap+fastinfoset
+# application/soap+xml
+application/sparql-query			rq
+application/sparql-results+xml			srx
+# application/spirits-event+xml
+application/srgs				gram
+application/srgs+xml				grxml
+application/sru+xml				sru
+application/ssdl+xml				ssdl
+application/ssml+xml				ssml
+# application/tamp-apex-update
+# application/tamp-apex-update-confirm
+# application/tamp-community-update
+# application/tamp-community-update-confirm
+# application/tamp-error
+# application/tamp-sequence-adjust
+# application/tamp-sequence-adjust-confirm
+# application/tamp-status-query
+# application/tamp-status-response
+# application/tamp-update
+# application/tamp-update-confirm
+application/tei+xml				tei teicorpus
+application/thraud+xml				tfi
+# application/timestamp-query
+# application/timestamp-reply
+application/timestamped-data			tsd
+# application/tve-trigger
+# application/ulpfec
+# application/vcard+xml
+# application/vemmi
+# application/vividence.scriptfile
+# application/vnd.3gpp.bsf+xml
+application/vnd.3gpp.pic-bw-large		plb
+application/vnd.3gpp.pic-bw-small		psb
+application/vnd.3gpp.pic-bw-var			pvb
+# application/vnd.3gpp.sms
+# application/vnd.3gpp2.bcmcsinfo+xml
+# application/vnd.3gpp2.sms
+application/vnd.3gpp2.tcap			tcap
+application/vnd.3m.post-it-notes		pwn
+application/vnd.accpac.simply.aso		aso
+application/vnd.accpac.simply.imp		imp
+application/vnd.acucobol			acu
+application/vnd.acucorp				atc acutc
+application/vnd.adobe.air-application-installer-package+zip	air
+application/vnd.adobe.formscentral.fcdt		fcdt
+application/vnd.adobe.fxp			fxp fxpl
+# application/vnd.adobe.partial-upload
+application/vnd.adobe.xdp+xml			xdp
+application/vnd.adobe.xfdf			xfdf
+# application/vnd.aether.imp
+# application/vnd.ah-barcode
+application/vnd.ahead.space			ahead
+application/vnd.airzip.filesecure.azf		azf
+application/vnd.airzip.filesecure.azs		azs
+application/vnd.amazon.ebook			azw
+application/vnd.americandynamics.acc		acc
+application/vnd.amiga.ami			ami
+# application/vnd.amundsen.maze+xml
+application/vnd.android.package-archive		apk
+application/vnd.anser-web-certificate-issue-initiation	cii
+application/vnd.anser-web-funds-transfer-initiation	fti
+application/vnd.antix.game-component		atx
+application/vnd.apple.installer+xml		mpkg
+application/vnd.apple.mpegurl			m3u8
+# application/vnd.arastra.swi
+application/vnd.aristanetworks.swi		swi
+application/vnd.astraea-software.iota		iota
+application/vnd.audiograph			aep
+# application/vnd.autopackage
+# application/vnd.avistar+xml
+application/vnd.blueice.multipass		mpm
+# application/vnd.bluetooth.ep.oob
+application/vnd.bmi				bmi
+application/vnd.businessobjects			rep
+# application/vnd.cab-jscript
+# application/vnd.canon-cpdl
+# application/vnd.canon-lips
+# application/vnd.cendio.thinlinc.clientconf
+application/vnd.chemdraw+xml			cdxml
+application/vnd.chipnuts.karaoke-mmd		mmd
+application/vnd.cinderella			cdy
+# application/vnd.cirpack.isdn-ext
+application/vnd.claymore			cla
+application/vnd.cloanto.rp9			rp9
+application/vnd.clonk.c4group			c4g c4d c4f c4p c4u
+application/vnd.cluetrust.cartomobile-config		c11amc
+application/vnd.cluetrust.cartomobile-config-pkg	c11amz
+# application/vnd.collection+json
+# application/vnd.commerce-battelle
+application/vnd.commonspace			csp
+application/vnd.contact.cmsg			cdbcmsg
+application/vnd.cosmocaller			cmc
+application/vnd.crick.clicker			clkx
+application/vnd.crick.clicker.keyboard		clkk
+application/vnd.crick.clicker.palette		clkp
+application/vnd.crick.clicker.template		clkt
+application/vnd.crick.clicker.wordbank		clkw
+application/vnd.criticaltools.wbs+xml		wbs
+application/vnd.ctc-posml			pml
+# application/vnd.ctct.ws+xml
+# application/vnd.cups-pdf
+# application/vnd.cups-postscript
+application/vnd.cups-ppd			ppd
+# application/vnd.cups-raster
+# application/vnd.cups-raw
+# application/vnd.curl
+application/vnd.curl.car			car
+application/vnd.curl.pcurl			pcurl
+# application/vnd.cybank
+application/vnd.dart				dart
+application/vnd.data-vision.rdz			rdz
+application/vnd.dece.data			uvf uvvf uvd uvvd
+application/vnd.dece.ttml+xml			uvt uvvt
+application/vnd.dece.unspecified		uvx uvvx
+application/vnd.dece.zip			uvz uvvz
+application/vnd.denovo.fcselayout-link		fe_launch
+# application/vnd.dir-bi.plate-dl-nosuffix
+application/vnd.dna				dna
+application/vnd.dolby.mlp			mlp
+# application/vnd.dolby.mobile.1
+# application/vnd.dolby.mobile.2
+application/vnd.dpgraph				dpg
+application/vnd.dreamfactory			dfac
+application/vnd.ds-keypoint			kpxx
+application/vnd.dvb.ait				ait
+# application/vnd.dvb.dvbj
+# application/vnd.dvb.esgcontainer
+# application/vnd.dvb.ipdcdftnotifaccess
+# application/vnd.dvb.ipdcesgaccess
+# application/vnd.dvb.ipdcesgaccess2
+# application/vnd.dvb.ipdcesgpdd
+# application/vnd.dvb.ipdcroaming
+# application/vnd.dvb.iptv.alfec-base
+# application/vnd.dvb.iptv.alfec-enhancement
+# application/vnd.dvb.notif-aggregate-root+xml
+# application/vnd.dvb.notif-container+xml
+# application/vnd.dvb.notif-generic+xml
+# application/vnd.dvb.notif-ia-msglist+xml
+# application/vnd.dvb.notif-ia-registration-request+xml
+# application/vnd.dvb.notif-ia-registration-response+xml
+# application/vnd.dvb.notif-init+xml
+# application/vnd.dvb.pfr
+application/vnd.dvb.service			svc
+# application/vnd.dxr
+application/vnd.dynageo				geo
+# application/vnd.easykaraoke.cdgdownload
+# application/vnd.ecdis-update
+application/vnd.ecowin.chart			mag
+# application/vnd.ecowin.filerequest
+# application/vnd.ecowin.fileupdate
+# application/vnd.ecowin.series
+# application/vnd.ecowin.seriesrequest
+# application/vnd.ecowin.seriesupdate
+# application/vnd.emclient.accessrequest+xml
+application/vnd.enliven				nml
+# application/vnd.eprints.data+xml
+application/vnd.epson.esf			esf
+application/vnd.epson.msf			msf
+application/vnd.epson.quickanime		qam
+application/vnd.epson.salt			slt
+application/vnd.epson.ssf			ssf
+# application/vnd.ericsson.quickcall
+application/vnd.eszigno3+xml			es3 et3
+# application/vnd.etsi.aoc+xml
+# application/vnd.etsi.cug+xml
+# application/vnd.etsi.iptvcommand+xml
+# application/vnd.etsi.iptvdiscovery+xml
+# application/vnd.etsi.iptvprofile+xml
+# application/vnd.etsi.iptvsad-bc+xml
+# application/vnd.etsi.iptvsad-cod+xml
+# application/vnd.etsi.iptvsad-npvr+xml
+# application/vnd.etsi.iptvservice+xml
+# application/vnd.etsi.iptvsync+xml
+# application/vnd.etsi.iptvueprofile+xml
+# application/vnd.etsi.mcid+xml
+# application/vnd.etsi.overload-control-policy-dataset+xml
+# application/vnd.etsi.sci+xml
+# application/vnd.etsi.simservs+xml
+# application/vnd.etsi.tsl+xml
+# application/vnd.etsi.tsl.der
+# application/vnd.eudora.data
+application/vnd.ezpix-album			ez2
+application/vnd.ezpix-package			ez3
+# application/vnd.f-secure.mobile
+application/vnd.fdf				fdf
+application/vnd.fdsn.mseed			mseed
+application/vnd.fdsn.seed			seed dataless
+# application/vnd.ffsns
+# application/vnd.fints
+application/vnd.flographit			gph
+application/vnd.fluxtime.clip			ftc
+# application/vnd.font-fontforge-sfd
+application/vnd.framemaker			fm frame maker book
+application/vnd.frogans.fnc			fnc
+application/vnd.frogans.ltf			ltf
+application/vnd.fsc.weblaunch			fsc
+application/vnd.fujitsu.oasys			oas
+application/vnd.fujitsu.oasys2			oa2
+application/vnd.fujitsu.oasys3			oa3
+application/vnd.fujitsu.oasysgp			fg5
+application/vnd.fujitsu.oasysprs		bh2
+# application/vnd.fujixerox.art-ex
+# application/vnd.fujixerox.art4
+# application/vnd.fujixerox.hbpl
+application/vnd.fujixerox.ddd			ddd
+application/vnd.fujixerox.docuworks		xdw
+application/vnd.fujixerox.docuworks.binder	xbd
+# application/vnd.fut-misnet
+application/vnd.fuzzysheet			fzs
+application/vnd.genomatix.tuxedo		txd
+# application/vnd.geocube+xml
+application/vnd.geogebra.file			ggb
+application/vnd.geogebra.tool			ggt
+application/vnd.geometry-explorer		gex gre
+application/vnd.geonext				gxt
+application/vnd.geoplan				g2w
+application/vnd.geospace			g3w
+# application/vnd.globalplatform.card-content-mgt
+# application/vnd.globalplatform.card-content-mgt-response
+application/vnd.gmx				gmx
+application/vnd.google-earth.kml+xml		kml
+application/vnd.google-earth.kmz		kmz
+application/vnd.grafeq				gqf gqs
+# application/vnd.gridmp
+application/vnd.groove-account			gac
+application/vnd.groove-help			ghf
+application/vnd.groove-identity-message		gim
+application/vnd.groove-injector			grv
+application/vnd.groove-tool-message		gtm
+application/vnd.groove-tool-template		tpl
+application/vnd.groove-vcard			vcg
+# application/vnd.hal+json
+application/vnd.hal+xml				hal
+application/vnd.handheld-entertainment+xml	zmm
+application/vnd.hbci				hbci
+# application/vnd.hcl-bireports
+application/vnd.hhe.lesson-player		les
+application/vnd.hp-hpgl				hpgl
+application/vnd.hp-hpid				hpid
+application/vnd.hp-hps				hps
+application/vnd.hp-jlyt				jlt
+application/vnd.hp-pcl				pcl
+application/vnd.hp-pclxl			pclxl
+# application/vnd.httphone
+application/vnd.hydrostatix.sof-data		sfd-hdstx
+# application/vnd.hzn-3d-crossword
+# application/vnd.ibm.afplinedata
+# application/vnd.ibm.electronic-media
+application/vnd.ibm.minipay			mpy
+application/vnd.ibm.modcap			afp listafp list3820
+application/vnd.ibm.rights-management		irm
+application/vnd.ibm.secure-container		sc
+application/vnd.iccprofile			icc icm
+application/vnd.igloader			igl
+application/vnd.immervision-ivp			ivp
+application/vnd.immervision-ivu			ivu
+# application/vnd.informedcontrol.rms+xml
+# application/vnd.informix-visionary
+# application/vnd.infotech.project
+# application/vnd.infotech.project+xml
+# application/vnd.innopath.wamp.notification
+application/vnd.insors.igm			igm
+application/vnd.intercon.formnet		xpw xpx
+application/vnd.intergeo			i2g
+# application/vnd.intertrust.digibox
+# application/vnd.intertrust.nncp
+application/vnd.intu.qbo			qbo
+application/vnd.intu.qfx			qfx
+# application/vnd.iptc.g2.conceptitem+xml
+# application/vnd.iptc.g2.knowledgeitem+xml
+# application/vnd.iptc.g2.newsitem+xml
+# application/vnd.iptc.g2.newsmessage+xml
+# application/vnd.iptc.g2.packageitem+xml
+# application/vnd.iptc.g2.planningitem+xml
+application/vnd.ipunplugged.rcprofile		rcprofile
+application/vnd.irepository.package+xml		irp
+application/vnd.is-xpr				xpr
+application/vnd.isac.fcs			fcs
+application/vnd.jam				jam
+# application/vnd.japannet-directory-service
+# application/vnd.japannet-jpnstore-wakeup
+# application/vnd.japannet-payment-wakeup
+# application/vnd.japannet-registration
+# application/vnd.japannet-registration-wakeup
+# application/vnd.japannet-setstore-wakeup
+# application/vnd.japannet-verification
+# application/vnd.japannet-verification-wakeup
+application/vnd.jcp.javame.midlet-rms		rms
+application/vnd.jisp				jisp
+application/vnd.joost.joda-archive		joda
+application/vnd.kahootz				ktz ktr
+application/vnd.kde.karbon			karbon
+application/vnd.kde.kchart			chrt
+application/vnd.kde.kformula			kfo
+application/vnd.kde.kivio			flw
+application/vnd.kde.kontour			kon
+application/vnd.kde.kpresenter			kpr kpt
+application/vnd.kde.kspread			ksp
+application/vnd.kde.kword			kwd kwt
+application/vnd.kenameaapp			htke
+application/vnd.kidspiration			kia
+application/vnd.kinar				kne knp
+application/vnd.koan				skp skd skt skm
+application/vnd.kodak-descriptor		sse
+application/vnd.las.las+xml			lasxml
+# application/vnd.liberty-request+xml
+application/vnd.llamagraphics.life-balance.desktop	lbd
+application/vnd.llamagraphics.life-balance.exchange+xml	lbe
+application/vnd.lotus-1-2-3			123
+application/vnd.lotus-approach			apr
+application/vnd.lotus-freelance			pre
+application/vnd.lotus-notes			nsf
+application/vnd.lotus-organizer			org
+application/vnd.lotus-screencam			scm
+application/vnd.lotus-wordpro			lwp
+application/vnd.macports.portpkg		portpkg
+# application/vnd.marlin.drm.actiontoken+xml
+# application/vnd.marlin.drm.conftoken+xml
+# application/vnd.marlin.drm.license+xml
+# application/vnd.marlin.drm.mdcf
+application/vnd.mcd				mcd
+application/vnd.medcalcdata			mc1
+application/vnd.mediastation.cdkey		cdkey
+# application/vnd.meridian-slingshot
+application/vnd.mfer				mwf
+application/vnd.mfmp				mfm
+application/vnd.micrografx.flo			flo
+application/vnd.micrografx.igx			igx
+application/vnd.mif				mif
+# application/vnd.minisoft-hp3000-save
+# application/vnd.mitsubishi.misty-guard.trustweb
+application/vnd.mobius.daf			daf
+application/vnd.mobius.dis			dis
+application/vnd.mobius.mbk			mbk
+application/vnd.mobius.mqy			mqy
+application/vnd.mobius.msl			msl
+application/vnd.mobius.plc			plc
+application/vnd.mobius.txf			txf
+application/vnd.mophun.application		mpn
+application/vnd.mophun.certificate		mpc
+# application/vnd.motorola.flexsuite
+# application/vnd.motorola.flexsuite.adsi
+# application/vnd.motorola.flexsuite.fis
+# application/vnd.motorola.flexsuite.gotap
+# application/vnd.motorola.flexsuite.kmr
+# application/vnd.motorola.flexsuite.ttc
+# application/vnd.motorola.flexsuite.wem
+# application/vnd.motorola.iprm
+application/vnd.mozilla.xul+xml			xul
+application/vnd.ms-artgalry			cil
+# application/vnd.ms-asf
+application/vnd.ms-cab-compressed		cab
+# application/vnd.ms-color.iccprofile
+application/vnd.ms-excel			xls xlm xla xlc xlt xlw
+application/vnd.ms-excel.addin.macroenabled.12		xlam
+application/vnd.ms-excel.sheet.binary.macroenabled.12	xlsb
+application/vnd.ms-excel.sheet.macroenabled.12		xlsm
+application/vnd.ms-excel.template.macroenabled.12	xltm
+application/vnd.ms-fontobject			eot
+application/vnd.ms-htmlhelp			chm
+application/vnd.ms-ims				ims
+application/vnd.ms-lrm				lrm
+# application/vnd.ms-office.activex+xml
+application/vnd.ms-officetheme			thmx
+# application/vnd.ms-opentype
+# application/vnd.ms-package.obfuscated-opentype
+application/vnd.ms-pki.seccat			cat
+application/vnd.ms-pki.stl			stl
+# application/vnd.ms-playready.initiator+xml
+application/vnd.ms-powerpoint			ppt pps pot
+application/vnd.ms-powerpoint.addin.macroenabled.12		ppam
+application/vnd.ms-powerpoint.presentation.macroenabled.12	pptm
+application/vnd.ms-powerpoint.slide.macroenabled.12		sldm
+application/vnd.ms-powerpoint.slideshow.macroenabled.12		ppsm
+application/vnd.ms-powerpoint.template.macroenabled.12		potm
+# application/vnd.ms-printing.printticket+xml
+application/vnd.ms-project			mpp mpt
+# application/vnd.ms-tnef
+# application/vnd.ms-wmdrm.lic-chlg-req
+# application/vnd.ms-wmdrm.lic-resp
+# application/vnd.ms-wmdrm.meter-chlg-req
+# application/vnd.ms-wmdrm.meter-resp
+application/vnd.ms-word.document.macroenabled.12	docm
+application/vnd.ms-word.template.macroenabled.12	dotm
+application/vnd.ms-works			wps wks wcm wdb
+application/vnd.ms-wpl				wpl
+application/vnd.ms-xpsdocument			xps
+application/vnd.mseq				mseq
+# application/vnd.msign
+# application/vnd.multiad.creator
+# application/vnd.multiad.creator.cif
+# application/vnd.music-niff
+application/vnd.musician			mus
+application/vnd.muvee.style			msty
+application/vnd.mynfc				taglet
+# application/vnd.ncd.control
+# application/vnd.ncd.reference
+# application/vnd.nervana
+# application/vnd.netfpx
+application/vnd.neurolanguage.nlu		nlu
+application/vnd.nitf				ntf nitf
+application/vnd.noblenet-directory		nnd
+application/vnd.noblenet-sealer			nns
+application/vnd.noblenet-web			nnw
+# application/vnd.nokia.catalogs
+# application/vnd.nokia.conml+wbxml
+# application/vnd.nokia.conml+xml
+# application/vnd.nokia.isds-radio-presets
+# application/vnd.nokia.iptv.config+xml
+# application/vnd.nokia.landmark+wbxml
+# application/vnd.nokia.landmark+xml
+# application/vnd.nokia.landmarkcollection+xml
+# application/vnd.nokia.n-gage.ac+xml
+application/vnd.nokia.n-gage.data		ngdat
+application/vnd.nokia.n-gage.symbian.install	n-gage
+# application/vnd.nokia.ncd
+# application/vnd.nokia.pcd+wbxml
+# application/vnd.nokia.pcd+xml
+application/vnd.nokia.radio-preset		rpst
+application/vnd.nokia.radio-presets		rpss
+application/vnd.novadigm.edm			edm
+application/vnd.novadigm.edx			edx
+application/vnd.novadigm.ext			ext
+# application/vnd.ntt-local.file-transfer
+# application/vnd.ntt-local.sip-ta_remote
+# application/vnd.ntt-local.sip-ta_tcp_stream
+application/vnd.oasis.opendocument.chart		odc
+application/vnd.oasis.opendocument.chart-template	otc
+application/vnd.oasis.opendocument.database		odb
+application/vnd.oasis.opendocument.formula		odf
+application/vnd.oasis.opendocument.formula-template	odft
+application/vnd.oasis.opendocument.graphics		odg
+application/vnd.oasis.opendocument.graphics-template	otg
+application/vnd.oasis.opendocument.image		odi
+application/vnd.oasis.opendocument.image-template	oti
+application/vnd.oasis.opendocument.presentation		odp
+application/vnd.oasis.opendocument.presentation-template	otp
+application/vnd.oasis.opendocument.spreadsheet		ods
+application/vnd.oasis.opendocument.spreadsheet-template	ots
+application/vnd.oasis.opendocument.text			odt
+application/vnd.oasis.opendocument.text-master		odm
+application/vnd.oasis.opendocument.text-template	ott
+application/vnd.oasis.opendocument.text-web		oth
+# application/vnd.obn
+# application/vnd.oftn.l10n+json
+# application/vnd.oipf.contentaccessdownload+xml
+# application/vnd.oipf.contentaccessstreaming+xml
+# application/vnd.oipf.cspg-hexbinary
+# application/vnd.oipf.dae.svg+xml
+# application/vnd.oipf.dae.xhtml+xml
+# application/vnd.oipf.mippvcontrolmessage+xml
+# application/vnd.oipf.pae.gem
+# application/vnd.oipf.spdiscovery+xml
+# application/vnd.oipf.spdlist+xml
+# application/vnd.oipf.ueprofile+xml
+# application/vnd.oipf.userprofile+xml
+application/vnd.olpc-sugar			xo
+# application/vnd.oma-scws-config
+# application/vnd.oma-scws-http-request
+# application/vnd.oma-scws-http-response
+# application/vnd.oma.bcast.associated-procedure-parameter+xml
+# application/vnd.oma.bcast.drm-trigger+xml
+# application/vnd.oma.bcast.imd+xml
+# application/vnd.oma.bcast.ltkm
+# application/vnd.oma.bcast.notification+xml
+# application/vnd.oma.bcast.provisioningtrigger
+# application/vnd.oma.bcast.sgboot
+# application/vnd.oma.bcast.sgdd+xml
+# application/vnd.oma.bcast.sgdu
+# application/vnd.oma.bcast.simple-symbol-container
+# application/vnd.oma.bcast.smartcard-trigger+xml
+# application/vnd.oma.bcast.sprov+xml
+# application/vnd.oma.bcast.stkm
+# application/vnd.oma.cab-address-book+xml
+# application/vnd.oma.cab-feature-handler+xml
+# application/vnd.oma.cab-pcc+xml
+# application/vnd.oma.cab-user-prefs+xml
+# application/vnd.oma.dcd
+# application/vnd.oma.dcdc
+application/vnd.oma.dd2+xml			dd2
+# application/vnd.oma.drm.risd+xml
+# application/vnd.oma.group-usage-list+xml
+# application/vnd.oma.pal+xml
+# application/vnd.oma.poc.detailed-progress-report+xml
+# application/vnd.oma.poc.final-report+xml
+# application/vnd.oma.poc.groups+xml
+# application/vnd.oma.poc.invocation-descriptor+xml
+# application/vnd.oma.poc.optimized-progress-report+xml
+# application/vnd.oma.push
+# application/vnd.oma.scidm.messages+xml
+# application/vnd.oma.xcap-directory+xml
+# application/vnd.omads-email+xml
+# application/vnd.omads-file+xml
+# application/vnd.omads-folder+xml
+# application/vnd.omaloc-supl-init
+application/vnd.openofficeorg.extension		oxt
+# application/vnd.openxmlformats-officedocument.custom-properties+xml
+# application/vnd.openxmlformats-officedocument.customxmlproperties+xml
+# application/vnd.openxmlformats-officedocument.drawing+xml
+# application/vnd.openxmlformats-officedocument.drawingml.chart+xml
+# application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml
+# application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml
+# application/vnd.openxmlformats-officedocument.extended-properties+xml
+# application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml
+# application/vnd.openxmlformats-officedocument.presentationml.comments+xml
+# application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml
+# application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml
+# application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml
+application/vnd.openxmlformats-officedocument.presentationml.presentation	pptx
+# application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml
+# application/vnd.openxmlformats-officedocument.presentationml.presprops+xml
+application/vnd.openxmlformats-officedocument.presentationml.slide	sldx
+# application/vnd.openxmlformats-officedocument.presentationml.slide+xml
+# application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml
+# application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml
+application/vnd.openxmlformats-officedocument.presentationml.slideshow	ppsx
+# application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml
+# application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml
+# application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml
+# application/vnd.openxmlformats-officedocument.presentationml.tags+xml
+application/vnd.openxmlformats-officedocument.presentationml.template	potx
+# application/vnd.openxmlformats-officedocument.presentationml.template.main+xml
+# application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml
+application/vnd.openxmlformats-officedocument.spreadsheetml.sheet	xlsx
+# application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml
+application/vnd.openxmlformats-officedocument.spreadsheetml.template	xltx
+# application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml
+# application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml
+# application/vnd.openxmlformats-officedocument.theme+xml
+# application/vnd.openxmlformats-officedocument.themeoverride+xml
+# application/vnd.openxmlformats-officedocument.vmldrawing
+# application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml
+application/vnd.openxmlformats-officedocument.wordprocessingml.document	docx
+# application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml
+application/vnd.openxmlformats-officedocument.wordprocessingml.template	dotx
+# application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml
+# application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml
+# application/vnd.openxmlformats-package.core-properties+xml
+# application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml
+# application/vnd.openxmlformats-package.relationships+xml
+# application/vnd.quobject-quoxdocument
+# application/vnd.osa.netdeploy
+application/vnd.osgeo.mapguide.package		mgp
+# application/vnd.osgi.bundle
+application/vnd.osgi.dp				dp
+application/vnd.osgi.subsystem			esa
+# application/vnd.otps.ct-kip+xml
+application/vnd.palm				pdb pqa oprc
+# application/vnd.paos.xml
+application/vnd.pawaafile			paw
+application/vnd.pg.format			str
+application/vnd.pg.osasli			ei6
+# application/vnd.piaccess.application-licence
+application/vnd.picsel				efif
+application/vnd.pmi.widget			wg
+# application/vnd.poc.group-advertisement+xml
+application/vnd.pocketlearn			plf
+application/vnd.powerbuilder6			pbd
+# application/vnd.powerbuilder6-s
+# application/vnd.powerbuilder7
+# application/vnd.powerbuilder7-s
+# application/vnd.powerbuilder75
+# application/vnd.powerbuilder75-s
+# application/vnd.preminet
+application/vnd.previewsystems.box		box
+application/vnd.proteus.magazine		mgz
+application/vnd.publishare-delta-tree		qps
+application/vnd.pvi.ptid1			ptid
+# application/vnd.pwg-multiplexed
+# application/vnd.pwg-xhtml-print+xml
+# application/vnd.qualcomm.brew-app-res
+application/vnd.quark.quarkxpress		qxd qxt qwd qwt qxl qxb
+# application/vnd.radisys.moml+xml
+# application/vnd.radisys.msml+xml
+# application/vnd.radisys.msml-audit+xml
+# application/vnd.radisys.msml-audit-conf+xml
+# application/vnd.radisys.msml-audit-conn+xml
+# application/vnd.radisys.msml-audit-dialog+xml
+# application/vnd.radisys.msml-audit-stream+xml
+# application/vnd.radisys.msml-conf+xml
+# application/vnd.radisys.msml-dialog+xml
+# application/vnd.radisys.msml-dialog-base+xml
+# application/vnd.radisys.msml-dialog-fax-detect+xml
+# application/vnd.radisys.msml-dialog-fax-sendrecv+xml
+# application/vnd.radisys.msml-dialog-group+xml
+# application/vnd.radisys.msml-dialog-speech+xml
+# application/vnd.radisys.msml-dialog-transform+xml
+# application/vnd.rainstor.data
+# application/vnd.rapid
+application/vnd.realvnc.bed			bed
+application/vnd.recordare.musicxml		mxl
+application/vnd.recordare.musicxml+xml		musicxml
+# application/vnd.renlearn.rlprint
+application/vnd.rig.cryptonote			cryptonote
+application/vnd.rim.cod				cod
+application/vnd.rn-realmedia			rm
+application/vnd.rn-realmedia-vbr		rmvb
+application/vnd.route66.link66+xml		link66
+# application/vnd.rs-274x
+# application/vnd.ruckus.download
+# application/vnd.s3sms
+application/vnd.sailingtracker.track		st
+# application/vnd.sbm.cid
+# application/vnd.sbm.mid2
+# application/vnd.scribus
+# application/vnd.sealed.3df
+# application/vnd.sealed.csf
+# application/vnd.sealed.doc
+# application/vnd.sealed.eml
+# application/vnd.sealed.mht
+# application/vnd.sealed.net
+# application/vnd.sealed.ppt
+# application/vnd.sealed.tiff
+# application/vnd.sealed.xls
+# application/vnd.sealedmedia.softseal.html
+# application/vnd.sealedmedia.softseal.pdf
+application/vnd.seemail				see
+application/vnd.sema				sema
+application/vnd.semd				semd
+application/vnd.semf				semf
+application/vnd.shana.informed.formdata		ifm
+application/vnd.shana.informed.formtemplate	itp
+application/vnd.shana.informed.interchange	iif
+application/vnd.shana.informed.package		ipk
+application/vnd.simtech-mindmapper		twd twds
+application/vnd.smaf				mmf
+# application/vnd.smart.notebook
+application/vnd.smart.teacher			teacher
+# application/vnd.software602.filler.form+xml
+# application/vnd.software602.filler.form-xml-zip
+application/vnd.solent.sdkm+xml			sdkm sdkd
+application/vnd.spotfire.dxp			dxp
+application/vnd.spotfire.sfs			sfs
+# application/vnd.sss-cod
+# application/vnd.sss-dtf
+# application/vnd.sss-ntf
+application/vnd.stardivision.calc		sdc
+application/vnd.stardivision.draw		sda
+application/vnd.stardivision.impress		sdd
+application/vnd.stardivision.math		smf
+application/vnd.stardivision.writer		sdw vor
+application/vnd.stardivision.writer-global	sgl
+application/vnd.stepmania.package		smzip
+application/vnd.stepmania.stepchart		sm
+# application/vnd.street-stream
+application/vnd.sun.xml.calc			sxc
+application/vnd.sun.xml.calc.template		stc
+application/vnd.sun.xml.draw			sxd
+application/vnd.sun.xml.draw.template		std
+application/vnd.sun.xml.impress			sxi
+application/vnd.sun.xml.impress.template	sti
+application/vnd.sun.xml.math			sxm
+application/vnd.sun.xml.writer			sxw
+application/vnd.sun.xml.writer.global		sxg
+application/vnd.sun.xml.writer.template		stw
+# application/vnd.sun.wadl+xml
+application/vnd.sus-calendar			sus susp
+application/vnd.svd				svd
+# application/vnd.swiftview-ics
+application/vnd.symbian.install			sis sisx
+application/vnd.syncml+xml			xsm
+application/vnd.syncml.dm+wbxml			bdm
+application/vnd.syncml.dm+xml			xdm
+# application/vnd.syncml.dm.notification
+# application/vnd.syncml.ds.notification
+application/vnd.tao.intent-module-archive	tao
+application/vnd.tcpdump.pcap			pcap cap dmp
+application/vnd.tmobile-livetv			tmo
+application/vnd.trid.tpt			tpt
+application/vnd.triscape.mxs			mxs
+application/vnd.trueapp				tra
+# application/vnd.truedoc
+# application/vnd.ubisoft.webplayer
+application/vnd.ufdl				ufd ufdl
+application/vnd.uiq.theme			utz
+application/vnd.umajin				umj
+application/vnd.unity				unityweb
+application/vnd.uoml+xml			uoml
+# application/vnd.uplanet.alert
+# application/vnd.uplanet.alert-wbxml
+# application/vnd.uplanet.bearer-choice
+# application/vnd.uplanet.bearer-choice-wbxml
+# application/vnd.uplanet.cacheop
+# application/vnd.uplanet.cacheop-wbxml
+# application/vnd.uplanet.channel
+# application/vnd.uplanet.channel-wbxml
+# application/vnd.uplanet.list
+# application/vnd.uplanet.list-wbxml
+# application/vnd.uplanet.listcmd
+# application/vnd.uplanet.listcmd-wbxml
+# application/vnd.uplanet.signal
+application/vnd.vcx				vcx
+# application/vnd.vd-study
+# application/vnd.vectorworks
+# application/vnd.verimatrix.vcas
+# application/vnd.vidsoft.vidconference
+application/vnd.visio				vsd vst vss vsw
+application/vnd.visionary			vis
+# application/vnd.vividence.scriptfile
+application/vnd.vsf				vsf
+# application/vnd.wap.sic
+# application/vnd.wap.slc
+application/vnd.wap.wbxml			wbxml
+application/vnd.wap.wmlc			wmlc
+application/vnd.wap.wmlscriptc			wmlsc
+application/vnd.webturbo			wtb
+# application/vnd.wfa.wsc
+# application/vnd.wmc
+# application/vnd.wmf.bootstrap
+# application/vnd.wolfram.mathematica
+# application/vnd.wolfram.mathematica.package
+application/vnd.wolfram.player			nbp
+application/vnd.wordperfect			wpd
+application/vnd.wqd				wqd
+# application/vnd.wrq-hp3000-labelled
+application/vnd.wt.stf				stf
+# application/vnd.wv.csp+wbxml
+# application/vnd.wv.csp+xml
+# application/vnd.wv.ssp+xml
+application/vnd.xara				xar
+application/vnd.xfdl				xfdl
+# application/vnd.xfdl.webform
+# application/vnd.xmi+xml
+# application/vnd.xmpie.cpkg
+# application/vnd.xmpie.dpkg
+# application/vnd.xmpie.plan
+# application/vnd.xmpie.ppkg
+# application/vnd.xmpie.xlim
+application/vnd.yamaha.hv-dic			hvd
+application/vnd.yamaha.hv-script		hvs
+application/vnd.yamaha.hv-voice			hvp
+application/vnd.yamaha.openscoreformat			osf
+application/vnd.yamaha.openscoreformat.osfpvg+xml	osfpvg
+# application/vnd.yamaha.remote-setup
+application/vnd.yamaha.smaf-audio		saf
+application/vnd.yamaha.smaf-phrase		spf
+# application/vnd.yamaha.through-ngn
+# application/vnd.yamaha.tunnel-udpencap
+application/vnd.yellowriver-custom-menu		cmp
+application/vnd.zul				zir zirz
+application/vnd.zzazz.deck+xml			zaz
+application/voicexml+xml			vxml
+# application/vq-rtcpxr
+# application/watcherinfo+xml
+# application/whoispp-query
+# application/whoispp-response
+application/widget				wgt
+application/winhlp				hlp
+# application/wita
+# application/wordperfect5.1
+application/wsdl+xml				wsdl
+application/wspolicy+xml			wspolicy
+application/x-7z-compressed			7z
+application/x-abiword				abw
+application/x-ace-compressed			ace
+# application/x-amf
+application/x-apple-diskimage			dmg
+application/x-authorware-bin			aab x32 u32 vox
+application/x-authorware-map			aam
+application/x-authorware-seg			aas
+application/x-bcpio				bcpio
+application/x-bittorrent			torrent
+application/x-blorb				blb blorb
+application/x-bzip				bz
+application/x-bzip2				bz2 boz
+application/x-cbr				cbr cba cbt cbz cb7
+application/x-cdlink				vcd
+application/x-cfs-compressed			cfs
+application/x-chat				chat
+application/x-chess-pgn				pgn
+application/x-conference			nsc
+# application/x-compress
+application/x-cpio				cpio
+application/x-csh				csh
+application/x-debian-package			deb udeb
+application/x-dgc-compressed			dgc
+application/x-director			dir dcr dxr cst cct cxt w3d fgd swa
+application/x-doom				wad
+application/x-dtbncx+xml			ncx
+application/x-dtbook+xml			dtb
+application/x-dtbresource+xml			res
+application/x-dvi				dvi
+application/x-envoy				evy
+application/x-eva				eva
+application/x-font-bdf				bdf
+# application/x-font-dos
+# application/x-font-framemaker
+application/x-font-ghostscript			gsf
+# application/x-font-libgrx
+application/x-font-linux-psf			psf
+application/x-font-otf				otf
+application/x-font-pcf				pcf
+application/x-font-snf				snf
+# application/x-font-speedo
+# application/x-font-sunos-news
+application/x-font-ttf				ttf ttc
+application/x-font-type1			pfa pfb pfm afm
+application/font-woff				woff
+# application/x-font-vfont
+application/x-freearc				arc
+application/x-futuresplash			spl
+application/x-gca-compressed			gca
+application/x-glulx				ulx
+application/x-gnumeric				gnumeric
+application/x-gramps-xml			gramps
+application/x-gtar				gtar
+# application/x-gzip
+application/x-hdf				hdf
+application/x-install-instructions		install
+application/x-iso9660-image			iso
+application/x-java-jnlp-file			jnlp
+application/x-latex				latex
+application/x-lzh-compressed			lzh lha
+application/x-mie				mie
+application/x-mobipocket-ebook			prc mobi
+application/x-ms-application			application
+application/x-ms-shortcut			lnk
+application/x-ms-wmd				wmd
+application/x-ms-wmz				wmz
+application/x-ms-xbap				xbap
+application/x-msaccess				mdb
+application/x-msbinder				obd
+application/x-mscardfile			crd
+application/x-msclip				clp
+application/x-msdownload			exe dll com bat msi
+application/x-msmediaview			mvb m13 m14
+application/x-msmetafile			wmf wmz emf emz
+application/x-msmoney				mny
+application/x-mspublisher			pub
+application/x-msschedule			scd
+application/x-msterminal			trm
+application/x-mswrite				wri
+application/x-netcdf				nc cdf
+application/x-nzb				nzb
+application/x-pkcs12				p12 pfx
+application/x-pkcs7-certificates		p7b spc
+application/x-pkcs7-certreqresp			p7r
+application/x-rar-compressed			rar
+application/x-research-info-systems		ris
+application/x-sh				sh
+application/x-shar				shar
+application/x-shockwave-flash			swf
+application/x-silverlight-app			xap
+application/x-sql				sql
+application/x-stuffit				sit
+application/x-stuffitx				sitx
+application/x-subrip				srt
+application/x-sv4cpio				sv4cpio
+application/x-sv4crc				sv4crc
+application/x-t3vm-image			t3
+application/x-tads				gam
+application/x-tar				tar
+application/x-tcl				tcl
+application/x-tex				tex
+application/x-tex-tfm				tfm
+application/x-texinfo				texinfo texi
+application/x-tgif				obj
+application/x-ustar				ustar
+application/x-wais-source			src
+application/x-x509-ca-cert			der crt
+application/x-xfig				fig
+application/x-xliff+xml				xlf
+application/x-xpinstall				xpi
+application/x-xz				xz
+application/x-zmachine				z1 z2 z3 z4 z5 z6 z7 z8
+# application/x400-bp
+application/xaml+xml				xaml
+# application/xcap-att+xml
+# application/xcap-caps+xml
+application/xcap-diff+xml			xdf
+# application/xcap-el+xml
+# application/xcap-error+xml
+# application/xcap-ns+xml
+# application/xcon-conference-info-diff+xml
+# application/xcon-conference-info+xml
+application/xenc+xml				xenc
+application/xhtml+xml				xhtml xht
+# application/xhtml-voice+xml
+application/xml					xml xsl
+application/xml-dtd				dtd
+# application/xml-external-parsed-entity
+# application/xmpp+xml
+application/xop+xml				xop
+application/xproc+xml				xpl
+application/xslt+xml				xslt
+application/xspf+xml				xspf
+application/xv+xml				mxml xhvml xvml xvm
+application/yang				yang
+application/yin+xml				yin
+application/zip					zip
+# audio/1d-interleaved-parityfec
+# audio/32kadpcm
+# audio/3gpp
+# audio/3gpp2
+# audio/ac3
+audio/adpcm					adp
+# audio/amr
+# audio/amr-wb
+# audio/amr-wb+
+# audio/asc
+# audio/atrac-advanced-lossless
+# audio/atrac-x
+# audio/atrac3
+audio/basic					au snd
+# audio/bv16
+# audio/bv32
+# audio/clearmode
+# audio/cn
+# audio/dat12
+# audio/dls
+# audio/dsr-es201108
+# audio/dsr-es202050
+# audio/dsr-es202211
+# audio/dsr-es202212
+# audio/dv
+# audio/dvi4
+# audio/eac3
+# audio/evrc
+# audio/evrc-qcp
+# audio/evrc0
+# audio/evrc1
+# audio/evrcb
+# audio/evrcb0
+# audio/evrcb1
+# audio/evrcwb
+# audio/evrcwb0
+# audio/evrcwb1
+# audio/example
+# audio/fwdred
+# audio/g719
+# audio/g722
+# audio/g7221
+# audio/g723
+# audio/g726-16
+# audio/g726-24
+# audio/g726-32
+# audio/g726-40
+# audio/g728
+# audio/g729
+# audio/g7291
+# audio/g729d
+# audio/g729e
+# audio/gsm
+# audio/gsm-efr
+# audio/gsm-hr-08
+# audio/ilbc
+# audio/ip-mr_v2.5
+# audio/isac
+# audio/l16
+# audio/l20
+# audio/l24
+# audio/l8
+# audio/lpc
+audio/midi					mid midi kar rmi
+# audio/mobile-xmf
+audio/mp4					mp4a
+# audio/mp4a-latm
+# audio/mpa
+# audio/mpa-robust
+audio/mpeg					mpga mp2 mp2a mp3 m2a m3a
+# audio/mpeg4-generic
+# audio/musepack
+audio/ogg					oga ogg spx
+# audio/opus
+# audio/parityfec
+# audio/pcma
+# audio/pcma-wb
+# audio/pcmu-wb
+# audio/pcmu
+# audio/prs.sid
+# audio/qcelp
+# audio/red
+# audio/rtp-enc-aescm128
+# audio/rtp-midi
+# audio/rtx
+audio/s3m					s3m
+audio/silk					sil
+# audio/smv
+# audio/smv0
+# audio/smv-qcp
+# audio/sp-midi
+# audio/speex
+# audio/t140c
+# audio/t38
+# audio/telephone-event
+# audio/tone
+# audio/uemclip
+# audio/ulpfec
+# audio/vdvi
+# audio/vmr-wb
+# audio/vnd.3gpp.iufp
+# audio/vnd.4sb
+# audio/vnd.audiokoz
+# audio/vnd.celp
+# audio/vnd.cisco.nse
+# audio/vnd.cmles.radio-events
+# audio/vnd.cns.anp1
+# audio/vnd.cns.inf1
+audio/vnd.dece.audio				uva uvva
+audio/vnd.digital-winds				eol
+# audio/vnd.dlna.adts
+# audio/vnd.dolby.heaac.1
+# audio/vnd.dolby.heaac.2
+# audio/vnd.dolby.mlp
+# audio/vnd.dolby.mps
+# audio/vnd.dolby.pl2
+# audio/vnd.dolby.pl2x
+# audio/vnd.dolby.pl2z
+# audio/vnd.dolby.pulse.1
+audio/vnd.dra					dra
+audio/vnd.dts					dts
+audio/vnd.dts.hd				dtshd
+# audio/vnd.dvb.file
+# audio/vnd.everad.plj
+# audio/vnd.hns.audio
+audio/vnd.lucent.voice				lvp
+audio/vnd.ms-playready.media.pya		pya
+# audio/vnd.nokia.mobile-xmf
+# audio/vnd.nortel.vbk
+audio/vnd.nuera.ecelp4800			ecelp4800
+audio/vnd.nuera.ecelp7470			ecelp7470
+audio/vnd.nuera.ecelp9600			ecelp9600
+# audio/vnd.octel.sbc
+# audio/vnd.qcelp
+# audio/vnd.rhetorex.32kadpcm
+audio/vnd.rip					rip
+# audio/vnd.sealedmedia.softseal.mpeg
+# audio/vnd.vmx.cvsd
+# audio/vorbis
+# audio/vorbis-config
+audio/webm					weba
+audio/x-aac					aac
+audio/x-aiff					aif aiff aifc
+audio/x-caf					caf
+audio/x-flac					flac
+audio/x-matroska				mka
+audio/x-mpegurl					m3u
+audio/x-ms-wax					wax
+audio/x-ms-wma					wma
+audio/x-pn-realaudio				ram ra
+audio/x-pn-realaudio-plugin			rmp
+# audio/x-tta
+audio/x-wav					wav
+audio/xm					xm
+chemical/x-cdx					cdx
+chemical/x-cif					cif
+chemical/x-cmdf					cmdf
+chemical/x-cml					cml
+chemical/x-csml					csml
+# chemical/x-pdb
+chemical/x-xyz					xyz
+image/bmp					bmp
+image/cgm					cgm
+# image/example
+# image/fits
+image/g3fax					g3
+image/gif					gif
+image/ief					ief
+# image/jp2
+image/jpeg					jpeg jpg jpe
+# image/jpm
+# image/jpx
+image/ktx					ktx
+# image/naplps
+image/png					png
+image/prs.btif					btif
+# image/prs.pti
+image/sgi					sgi
+image/svg+xml					svg svgz
+# image/t38
+image/tiff					tiff tif
+# image/tiff-fx
+image/vnd.adobe.photoshop			psd
+# image/vnd.cns.inf2
+image/vnd.dece.graphic				uvi uvvi uvg uvvg
+image/vnd.dvb.subtitle				sub
+image/vnd.djvu					djvu djv
+image/vnd.dwg					dwg
+image/vnd.dxf					dxf
+image/vnd.fastbidsheet				fbs
+image/vnd.fpx					fpx
+image/vnd.fst					fst
+image/vnd.fujixerox.edmics-mmr			mmr
+image/vnd.fujixerox.edmics-rlc			rlc
+# image/vnd.globalgraphics.pgb
+# image/vnd.microsoft.icon
+# image/vnd.mix
+image/vnd.ms-modi				mdi
+image/vnd.ms-photo				wdp
+image/vnd.net-fpx				npx
+# image/vnd.radiance
+# image/vnd.sealed.png
+# image/vnd.sealedmedia.softseal.gif
+# image/vnd.sealedmedia.softseal.jpg
+# image/vnd.svf
+image/vnd.wap.wbmp				wbmp
+image/vnd.xiff					xif
+image/webp					webp
+image/x-3ds					3ds
+image/x-cmu-raster				ras
+image/x-cmx					cmx
+image/x-freehand				fh fhc fh4 fh5 fh7
+image/x-icon					ico
+image/x-mrsid-image				sid
+image/x-pcx					pcx
+image/x-pict					pic pct
+image/x-portable-anymap				pnm
+image/x-portable-bitmap				pbm
+image/x-portable-graymap			pgm
+image/x-portable-pixmap				ppm
+image/x-rgb					rgb
+image/x-tga					tga
+image/x-xbitmap					xbm
+image/x-xpixmap					xpm
+image/x-xwindowdump				xwd
+# message/cpim
+# message/delivery-status
+# message/disposition-notification
+# message/example
+# message/external-body
+# message/feedback-report
+# message/global
+# message/global-delivery-status
+# message/global-disposition-notification
+# message/global-headers
+# message/http
+# message/imdn+xml
+# message/news
+# message/partial
+message/rfc822					eml mime
+# message/s-http
+# message/sip
+# message/sipfrag
+# message/tracking-status
+# message/vnd.si.simp
+# model/example
+model/iges					igs iges
+model/mesh					msh mesh silo
+model/vnd.collada+xml				dae
+model/vnd.dwf					dwf
+# model/vnd.flatland.3dml
+model/vnd.gdl					gdl
+# model/vnd.gs-gdl
+# model/vnd.gs.gdl
+model/vnd.gtw					gtw
+# model/vnd.moml+xml
+model/vnd.mts					mts
+# model/vnd.parasolid.transmit.binary
+# model/vnd.parasolid.transmit.text
+model/vnd.vtu					vtu
+model/vrml					wrl vrml
+model/x3d+binary				x3db x3dbz
+model/x3d+vrml					x3dv x3dvz
+model/x3d+xml					x3d x3dz
+# multipart/alternative
+# multipart/appledouble
+# multipart/byteranges
+# multipart/digest
+# multipart/encrypted
+# multipart/example
+# multipart/form-data
+# multipart/header-set
+# multipart/mixed
+# multipart/parallel
+# multipart/related
+# multipart/report
+# multipart/signed
+# multipart/voice-message
+# text/1d-interleaved-parityfec
+text/cache-manifest				appcache
+text/calendar					ics ifb
+text/css					css
+text/csv					csv
+# text/directory
+# text/dns
+# text/ecmascript
+# text/enriched
+# text/example
+# text/fwdred
+text/html					html htm
+# text/javascript
+text/n3						n3
+# text/parityfec
+text/plain					txt text conf def list log in
+# text/prs.fallenstein.rst
+text/prs.lines.tag				dsc
+# text/vnd.radisys.msml-basic-layout
+# text/red
+# text/rfc822-headers
+text/richtext					rtx
+# text/rtf
+# text/rtp-enc-aescm128
+# text/rtx
+text/sgml					sgml sgm
+# text/t140
+text/tab-separated-values			tsv
+text/troff					t tr roff man me ms
+text/turtle					ttl
+# text/ulpfec
+text/uri-list					uri uris urls
+text/vcard					vcard
+# text/vnd.abc
+text/vnd.curl					curl
+text/vnd.curl.dcurl				dcurl
+text/vnd.curl.scurl				scurl
+text/vnd.curl.mcurl				mcurl
+# text/vnd.dmclientscript
+text/vnd.dvb.subtitle				sub
+# text/vnd.esmertec.theme-descriptor
+text/vnd.fly					fly
+text/vnd.fmi.flexstor				flx
+text/vnd.graphviz				gv
+text/vnd.in3d.3dml				3dml
+text/vnd.in3d.spot				spot
+# text/vnd.iptc.newsml
+# text/vnd.iptc.nitf
+# text/vnd.latex-z
+# text/vnd.motorola.reflex
+# text/vnd.ms-mediapackage
+# text/vnd.net2phone.commcenter.command
+# text/vnd.si.uricatalogue
+text/vnd.sun.j2me.app-descriptor		jad
+# text/vnd.trolltech.linguist
+# text/vnd.wap.si
+# text/vnd.wap.sl
+text/vnd.wap.wml				wml
+text/vnd.wap.wmlscript				wmls
+text/x-asm					s asm
+text/x-c					c cc cxx cpp h hh dic
+text/x-fortran					f for f77 f90
+text/x-java-source				java
+text/x-opml					opml
+text/x-pascal					p pas
+text/x-nfo					nfo
+text/x-setext					etx
+text/x-sfv					sfv
+text/x-uuencode					uu
+text/x-vcalendar				vcs
+text/x-vcard					vcf
+# text/xml
+# text/xml-external-parsed-entity
+# video/1d-interleaved-parityfec
+video/3gpp					3gp
+# video/3gpp-tt
+video/3gpp2					3g2
+# video/bmpeg
+# video/bt656
+# video/celb
+# video/dv
+# video/example
+video/h261					h261
+video/h263					h263
+# video/h263-1998
+# video/h263-2000
+video/h264					h264
+# video/h264-rcdo
+# video/h264-svc
+video/jpeg					jpgv
+# video/jpeg2000
+video/jpm					jpm jpgm
+video/mj2					mj2 mjp2
+# video/mp1s
+# video/mp2p
+# video/mp2t
+video/mp4					mp4 mp4v mpg4
+# video/mp4v-es
+video/mpeg					mpeg mpg mpe m1v m2v
+# video/mpeg4-generic
+# video/mpv
+# video/nv
+video/ogg					ogv
+# video/parityfec
+# video/pointer
+video/quicktime					qt mov
+# video/raw
+# video/rtp-enc-aescm128
+# video/rtx
+# video/smpte292m
+# video/ulpfec
+# video/vc1
+# video/vnd.cctv
+video/vnd.dece.hd				uvh uvvh
+video/vnd.dece.mobile				uvm uvvm
+# video/vnd.dece.mp4
+video/vnd.dece.pd				uvp uvvp
+video/vnd.dece.sd				uvs uvvs
+video/vnd.dece.video				uvv uvvv
+# video/vnd.directv.mpeg
+# video/vnd.directv.mpeg-tts
+# video/vnd.dlna.mpeg-tts
+video/vnd.dvb.file				dvb
+video/vnd.fvt					fvt
+# video/vnd.hns.video
+# video/vnd.iptvforum.1dparityfec-1010
+# video/vnd.iptvforum.1dparityfec-2005
+# video/vnd.iptvforum.2dparityfec-1010
+# video/vnd.iptvforum.2dparityfec-2005
+# video/vnd.iptvforum.ttsavc
+# video/vnd.iptvforum.ttsmpeg2
+# video/vnd.motorola.video
+# video/vnd.motorola.videop
+video/vnd.mpegurl				mxu m4u
+video/vnd.ms-playready.media.pyv		pyv
+# video/vnd.nokia.interleaved-multimedia
+# video/vnd.nokia.videovoip
+# video/vnd.objectvideo
+# video/vnd.sealed.mpeg1
+# video/vnd.sealed.mpeg4
+# video/vnd.sealed.swf
+# video/vnd.sealedmedia.softseal.mov
+video/vnd.uvvu.mp4				uvu uvvu
+video/vnd.vivo					viv
+video/webm					webm
+video/x-f4v					f4v
+video/x-fli					fli
+video/x-flv					flv
+video/x-m4v					m4v
+video/x-matroska				mkv mk3d mks
+video/x-mng					mng
+video/x-ms-asf					asf asx
+video/x-ms-vob					vob
+video/x-ms-wm					wm
+video/x-ms-wmv					wmv
+video/x-ms-wmx					wmx
+video/x-ms-wvx					wvx
+video/x-msvideo					avi
+video/x-sgi-movie				movie
+video/x-smv					smv
+x-conference/x-cooltalk				ice
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/types/node.types
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/types/node.types	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/mime/types/node.types	(revision 487)
@@ -0,0 +1,77 @@
+# What: WebVTT
+# Why: To allow formats intended for marking up external text track resources.
+# http://dev.w3.org/html5/webvtt/
+# Added by: niftylettuce
+text/vtt  vtt
+
+# What: Google Chrome Extension
+# Why: To allow apps to (work) be served with the right content type header.
+# http://codereview.chromium.org/2830017
+# Added by: niftylettuce
+application/x-chrome-extension  crx
+
+# What: HTC support
+# Why: To properly render .htc files such as CSS3PIE
+# Added by: niftylettuce
+text/x-component  htc
+
+# What: HTML5 application cache manifes ('.manifest' extension)
+# Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps
+# per https://developer.mozilla.org/en/offline_resources_in_firefox
+# Added by: louisremi
+text/cache-manifest  manifest
+
+# What: node binary buffer format
+# Why: semi-standard extension w/in the node community
+# Added by: tootallnate
+application/octet-stream  buffer
+
+# What: The "protected" MP-4 formats used by iTunes.
+# Why: Required for streaming music to browsers (?)
+# Added by: broofa
+application/mp4  m4p
+audio/mp4  m4a
+
+# What: Video format, Part of RFC1890
+# Why: See https://github.com/bentomas/node-mime/pull/6
+# Added by: mjrusso
+video/MP2T  ts
+
+# What: EventSource mime type
+# Why: mime type of Server-Sent Events stream
+# http://www.w3.org/TR/eventsource/#text-event-stream
+# Added by: francois2metz
+text/event-stream  event-stream
+
+# What: Mozilla App manifest mime type
+# Why: https://developer.mozilla.org/en/Apps/Manifest#Serving_manifests
+# Added by: ednapiranha
+application/x-web-app-manifest+json   webapp
+
+# What: Lua file types
+# Why: Googling around shows de-facto consensus on these
+# Added by: creationix (Issue #45)
+text/x-lua  lua
+application/x-lua-bytecode  luac
+
+# What: Markdown files, as per http://daringfireball.net/projects/markdown/syntax
+# Why: http://stackoverflow.com/questions/10701983/what-is-the-mime-type-for-markdown
+# Added by: avoidwork
+text/x-markdown  markdown md mkd
+
+# What: ini files
+# Why: because they're just text files
+# Added by: Matthew Kastor
+text/plain  ini
+
+# What: DASH Adaptive Streaming manifest
+# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video
+# Added by: eelcocramer
+application/dash+xml mdp
+
+# What: OpenType font files - http://www.microsoft.com/typography/otspec/
+# Why:  Browsers usually ignore the font MIME types and sniff the content,
+#       but Chrome, shows a warning if OpenType fonts aren't served with
+#       the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png.
+# Added by: alrra
+font/opentype  otf
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/.npmignore	(revision 487)
@@ -0,0 +1,2 @@
+node_modules
+.DS_Store
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/LICENSE.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/LICENSE.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/LICENSE.md	(revision 487)
@@ -0,0 +1,2 @@
+Copyright (c) 2010-2012 Robert Kieffer
+MIT License - http://opensource.org/licenses/mit-license.php
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/README.md	(revision 487)
@@ -0,0 +1,207 @@
+# node-uuid
+
+Simple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.
+
+Features:
+
+* Generate RFC4122 version 1 or version 4 UUIDs
+* Runs in node.js and all browsers.
+* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').
+* Cryptographically strong random # generation on supporting platforms
+* 1.1K minified and gzip'ed  (Want something smaller?  Check this [crazy shit](https://gist.github.com/982883) out! )
+* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)
+
+## Getting Started
+
+Install it in your browser:
+
+```html
+<script src="uuid.js"></script>
+```
+
+Or in node.js:
+
+```
+npm install node-uuid
+```
+
+```javascript
+var uuid = require('node-uuid');
+```
+
+Then create some ids ...
+
+```javascript
+// Generate a v1 (time-based) id
+uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
+
+// Generate a v4 (random) id
+uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'
+```
+
+## API
+
+### uuid.v1([`options` [, `buffer` [, `offset`]]])
+
+Generate and return a RFC4122 v1 (timestamp-based) UUID.
+
+* `options` - (Object) Optional uuid state to apply. Properties may include:
+
+  * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID.  See note 1.
+  * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence.  Default: An internally maintained clockseq is used.
+  * `msecs` - (Number | Date) Time in milliseconds since unix Epoch.  Default: The current time is used.
+  * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.
+
+* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
+* `offset` - (Number) Starting index in `buffer` at which to begin writing.
+
+Returns `buffer`, if specified, otherwise the string form of the UUID
+
+Notes:
+
+1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)
+
+Example: Generate string UUID with fully-specified options
+
+```javascript
+uuid.v1({
+  node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
+  clockseq: 0x1234,
+  msecs: new Date('2011-11-01').getTime(),
+  nsecs: 5678
+});   // -> "710b962e-041c-11e1-9234-0123456789ab"
+```
+
+Example: In-place generation of two binary IDs
+
+```javascript
+// Generate two ids in an array
+var arr = new Array(32); // -> []
+uuid.v1(null, arr, 0);   // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
+uuid.v1(null, arr, 16);  // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]
+
+// Optionally use uuid.unparse() to get stringify the ids
+uuid.unparse(buffer);    // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'
+uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'
+```
+
+### uuid.v4([`options` [, `buffer` [, `offset`]]])
+
+Generate and return a RFC4122 v4 UUID.
+
+* `options` - (Object) Optional uuid state to apply. Properties may include:
+
+  * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values
+  * `rng` - (Function) Random # generator to use.  Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.
+
+* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.
+* `offset` - (Number) Starting index in `buffer` at which to begin writing.
+
+Returns `buffer`, if specified, otherwise the string form of the UUID
+
+Example: Generate string UUID with fully-specified options
+
+```javascript
+uuid.v4({
+  random: [
+    0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,
+    0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36
+  ]
+});
+// -> "109156be-c4fb-41ea-b1b4-efe1671c5836"
+```
+
+Example: Generate two IDs in a single buffer
+
+```javascript
+var buffer = new Array(32); // (or 'new Buffer' in node.js)
+uuid.v4(null, buffer, 0);
+uuid.v4(null, buffer, 16);
+```
+
+### uuid.parse(id[, buffer[, offset]])
+### uuid.unparse(buffer[, offset])
+
+Parse and unparse UUIDs
+
+  * `id` - (String) UUID(-like) string
+  * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used
+  * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0
+
+Example parsing and unparsing a UUID string
+
+```javascript
+var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>
+var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'
+```
+
+### uuid.noConflict()
+
+(Browsers only) Set `uuid` property back to it's previous value.
+
+Returns the node-uuid object.
+
+Example:
+
+```javascript
+var myUuid = uuid.noConflict();
+myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'
+```
+
+## Deprecated APIs
+
+Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.
+
+### uuid([format [, buffer [, offset]]])
+
+uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).
+
+### uuid.BufferClass
+
+The class of container created when generating binary uuid data if no buffer argument is specified.  This is expected to go away, with no replacement API.
+
+## Testing
+
+In node.js
+
+```
+> cd test
+> node test.js
+```
+
+In Browser
+
+```
+open test/test.html
+```
+
+### Benchmarking
+
+Requires node.js
+
+```
+npm install uuid uuid-js
+node benchmark/benchmark.js
+```
+
+For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)
+
+For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).
+
+## Release notes
+
+### 1.4.0
+
+* Improved module context detection
+* Removed public RNG functions
+
+### 1.3.2
+
+* Improve tests and handling of v1() options (Issue #24)
+* Expose RNG option to allow for perf testing with different generators
+
+### 1.3.0
+
+* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!
+* Support for node.js crypto API
+* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/README.md	(revision 487)
@@ -0,0 +1,53 @@
+# node-uuid Benchmarks
+
+### Results
+
+To see the results of our benchmarks visit https://github.com/broofa/node-uuid/wiki/Benchmark
+
+### Run them yourself
+
+node-uuid comes with some benchmarks to measure performance of generating UUIDs. These can be run using node.js. node-uuid is being benchmarked against some other uuid modules, that are available through npm namely `uuid` and `uuid-js`.
+
+To prepare and run the benchmark issue;
+
+```
+npm install uuid uuid-js
+node benchmark/benchmark.js
+```
+
+You'll see an output like this one:
+
+```
+# v4
+nodeuuid.v4(): 854700 uuids/second
+nodeuuid.v4('binary'): 788643 uuids/second
+nodeuuid.v4('binary', buffer): 1336898 uuids/second
+uuid(): 479386 uuids/second
+uuid('binary'): 582072 uuids/second
+uuidjs.create(4): 312304 uuids/second
+
+# v1
+nodeuuid.v1(): 938086 uuids/second
+nodeuuid.v1('binary'): 683060 uuids/second
+nodeuuid.v1('binary', buffer): 1644736 uuids/second
+uuidjs.create(1): 190621 uuids/second
+```
+
+* The `uuid()` entries are for Nikhil Marathe's [uuid module](https://bitbucket.org/nikhilm/uuidjs) which is a wrapper around the native libuuid library.
+* The `uuidjs()` entries are for Patrick Negri's [uuid-js module](https://github.com/pnegri/uuid-js) which is a pure javascript implementation based on [UUID.js](https://github.com/LiosK/UUID.js) by LiosK.
+
+If you want to get more reliable results you can run the benchmark multiple times and write the output into a log file:
+
+```
+for i in {0..9}; do node benchmark/benchmark.js >> benchmark/bench_0.4.12.log; done;
+```
+
+If you're interested in how performance varies between different node versions, you can issue the above command multiple times.
+
+You can then use the shell script `bench.sh` provided in this directory to calculate the averages over all benchmark runs and draw a nice plot:
+
+```
+(cd benchmark/ && ./bench.sh)
+```
+
+This assumes you have [gnuplot](http://www.gnuplot.info/) and [ImageMagick](http://www.imagemagick.org/) installed. You'll find a nice `bench.png` graph in the `benchmark/` directory then.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu	(revision 487)
@@ -0,0 +1,174 @@
+#!/opt/local/bin/gnuplot -persist
+#
+#    
+#    	G N U P L O T
+#    	Version 4.4 patchlevel 3
+#    	last modified March 2011
+#    	System: Darwin 10.8.0
+#    
+#    	Copyright (C) 1986-1993, 1998, 2004, 2007-2010
+#    	Thomas Williams, Colin Kelley and many others
+#    
+#    	gnuplot home:     http://www.gnuplot.info
+#    	faq, bugs, etc:   type "help seeking-assistance"
+#    	immediate help:   type "help"
+#    	plot window:      hit 'h'
+set terminal postscript eps noenhanced defaultplex \
+ leveldefault color colortext \
+ solid linewidth 1.2 butt noclip \
+ palfuncparam 2000,0.003 \
+ "Helvetica" 14 
+set output 'bench.eps'
+unset clip points
+set clip one
+unset clip two
+set bar 1.000000 front
+set border 31 front linetype -1 linewidth 1.000
+set xdata
+set ydata
+set zdata
+set x2data
+set y2data
+set timefmt x "%d/%m/%y,%H:%M"
+set timefmt y "%d/%m/%y,%H:%M"
+set timefmt z "%d/%m/%y,%H:%M"
+set timefmt x2 "%d/%m/%y,%H:%M"
+set timefmt y2 "%d/%m/%y,%H:%M"
+set timefmt cb "%d/%m/%y,%H:%M"
+set boxwidth
+set style fill  empty border
+set style rectangle back fc lt -3 fillstyle   solid 1.00 border lt -1
+set style circle radius graph 0.02, first 0, 0 
+set dummy x,y
+set format x "% g"
+set format y "% g"
+set format x2 "% g"
+set format y2 "% g"
+set format z "% g"
+set format cb "% g"
+set angles radians
+unset grid
+set key title ""
+set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox
+set key noinvert samplen 4 spacing 1 width 0 height 0 
+set key maxcolumns 2 maxrows 0
+unset label
+unset arrow
+set style increment default
+unset style line
+set style line 1  linetype 1 linewidth 2.000 pointtype 1 pointsize default pointinterval 0
+unset style arrow
+set style histogram clustered gap 2 title  offset character 0, 0, 0
+unset logscale
+set offsets graph 0.05, 0.15, 0, 0
+set pointsize 1.5
+set pointintervalbox 1
+set encoding default
+unset polar
+unset parametric
+unset decimalsign
+set view 60, 30, 1, 1
+set samples 100, 100
+set isosamples 10, 10
+set surface
+unset contour
+set clabel '%8.3g'
+set mapping cartesian
+set datafile separator whitespace
+unset hidden3d
+set cntrparam order 4
+set cntrparam linear
+set cntrparam levels auto 5
+set cntrparam points 5
+set size ratio 0 1,1
+set origin 0,0
+set style data points
+set style function lines
+set xzeroaxis linetype -2 linewidth 1.000
+set yzeroaxis linetype -2 linewidth 1.000
+set zzeroaxis linetype -2 linewidth 1.000
+set x2zeroaxis linetype -2 linewidth 1.000
+set y2zeroaxis linetype -2 linewidth 1.000
+set ticslevel 0.5
+set mxtics default
+set mytics default
+set mztics default
+set mx2tics default
+set my2tics default
+set mcbtics default
+set xtics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0
+set xtics  norangelimit
+set xtics   ()
+set ytics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0
+set ytics autofreq  norangelimit
+set ztics border in scale 1,0.5 nomirror norotate  offset character 0, 0, 0
+set ztics autofreq  norangelimit
+set nox2tics
+set noy2tics
+set cbtics border in scale 1,0.5 mirror norotate  offset character 0, 0, 0
+set cbtics autofreq  norangelimit
+set title "" 
+set title  offset character 0, 0, 0 font "" norotate
+set timestamp bottom 
+set timestamp "" 
+set timestamp  offset character 0, 0, 0 font "" norotate
+set rrange [ * : * ] noreverse nowriteback  # (currently [8.98847e+307:-8.98847e+307] )
+set autoscale rfixmin
+set autoscale rfixmax
+set trange [ * : * ] noreverse nowriteback  # (currently [-5.00000:5.00000] )
+set autoscale tfixmin
+set autoscale tfixmax
+set urange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set autoscale ufixmin
+set autoscale ufixmax
+set vrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set autoscale vfixmin
+set autoscale vfixmax
+set xlabel "" 
+set xlabel  offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set x2label "" 
+set x2label  offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set xrange [ * : * ] noreverse nowriteback  # (currently [-0.150000:3.15000] )
+set autoscale xfixmin
+set autoscale xfixmax
+set x2range [ * : * ] noreverse nowriteback  # (currently [0.00000:3.00000] )
+set autoscale x2fixmin
+set autoscale x2fixmax
+set ylabel "" 
+set ylabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set y2label "" 
+set y2label  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback  # (currently [:] )
+set autoscale yfixmin
+set autoscale yfixmax
+set y2range [ * : * ] noreverse nowriteback  # (currently [0.00000:1.90000e+06] )
+set autoscale y2fixmin
+set autoscale y2fixmax
+set zlabel "" 
+set zlabel  offset character 0, 0, 0 font "" textcolor lt -1 norotate
+set zrange [ * : * ] noreverse nowriteback  # (currently [-10.0000:10.0000] )
+set autoscale zfixmin
+set autoscale zfixmax
+set cblabel "" 
+set cblabel  offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270
+set cbrange [ * : * ] noreverse nowriteback  # (currently [8.98847e+307:-8.98847e+307] )
+set autoscale cbfixmin
+set autoscale cbfixmax
+set zero 1e-08
+set lmargin  -1
+set bmargin  -1
+set rmargin  -1
+set tmargin  -1
+set pm3d explicit at s
+set pm3d scansautomatic
+set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean
+set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB 
+set palette rgbformulae 7, 5, 15
+set colorbox default
+set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault
+set loadpath 
+set fontpath 
+set fit noerrorvariables
+GNUTERM = "aqua"
+plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2
+#    EOF
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/bench.sh
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/bench.sh	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/bench.sh	(revision 487)
@@ -0,0 +1,34 @@
+#!/bin/bash
+
+# for a given node version run:
+# for i in {0..9}; do node benchmark.js >> bench_0.6.2.log; done;
+
+PATTERNS=('nodeuuid.v1()' "nodeuuid.v1('binary'," 'nodeuuid.v4()' "nodeuuid.v4('binary'," "uuid()" "uuid('binary')" 'uuidjs.create(1)' 'uuidjs.create(4)' '140byte')
+FILES=(node_uuid_v1_string node_uuid_v1_buf node_uuid_v4_string node_uuid_v4_buf libuuid_v4_string libuuid_v4_binary uuidjs_v1_string uuidjs_v4_string 140byte_es)
+INDICES=(2 3 2 3 2 2 2 2 2)
+VERSIONS=$( ls bench_*.log | sed -e 's/^bench_\([0-9\.]*\)\.log/\1/' | tr "\\n" " " )
+TMPJOIN="tmp_join"
+OUTPUT="bench_results.txt"
+
+for I in ${!FILES[*]}; do
+  F=${FILES[$I]}
+  P=${PATTERNS[$I]}
+  INDEX=${INDICES[$I]}
+  echo "version $F" > $F
+  for V in $VERSIONS; do
+    (VAL=$( grep "$P" bench_$V.log | LC_ALL=en_US awk '{ sum += $'$INDEX' } END { print sum/NR }' ); echo $V $VAL) >> $F
+  done
+  if [ $I == 0 ]; then
+    cat $F > $TMPJOIN
+  else
+    join $TMPJOIN $F > $OUTPUT
+    cp $OUTPUT $TMPJOIN
+  fi
+  rm $F
+done
+
+rm $TMPJOIN
+
+gnuplot bench.gnu
+convert -density 200 -resize 800x560 -flatten bench.eps bench.png
+rm bench.eps
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/benchmark-native.c	(revision 487)
@@ -0,0 +1,34 @@
+/*
+Test performance of native C UUID generation
+
+To Compile: cc -luuid benchmark-native.c -o benchmark-native
+*/
+
+#include <stdio.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <uuid/uuid.h>
+
+int main() {
+  uuid_t myid;
+  char buf[36+1];
+  int i;
+  struct timeval t;
+  double start, finish;
+
+  gettimeofday(&t, NULL);
+  start = t.tv_sec + t.tv_usec/1e6;
+
+  int n = 2e5;
+  for (i = 0; i < n; i++) {
+    uuid_generate(myid);
+    uuid_unparse(myid, buf);
+  }
+
+  gettimeofday(&t, NULL);
+  finish = t.tv_sec + t.tv_usec/1e6;
+  double dur = finish - start;
+
+  printf("%d uuids/sec", (int)(n/dur));
+  return 0;
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/benchmark/benchmark.js	(revision 487)
@@ -0,0 +1,84 @@
+try {
+  var nodeuuid = require('../uuid');
+} catch (e) {
+  console.error('node-uuid require failed - skipping tests');
+}
+
+try {
+  var uuid = require('uuid');
+} catch (e) {
+  console.error('uuid require failed - skipping tests');
+}
+
+try {
+  var uuidjs = require('uuid-js');
+} catch (e) {
+  console.error('uuid-js require failed - skipping tests');
+}
+
+var N = 5e5;
+
+function rate(msg, t) {
+  console.log(msg + ': ' +
+    (N / (Date.now() - t) * 1e3 | 0) +
+    ' uuids/second');
+}
+
+console.log('# v4');
+
+// node-uuid - string form
+if (nodeuuid) {
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4();
+  rate('nodeuuid.v4() - using node.js crypto RNG', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4({rng: nodeuuid.mathRNG});
+  rate('nodeuuid.v4() - using Math.random() RNG', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary');
+  rate('nodeuuid.v4(\'binary\')', t);
+
+  var buffer = new nodeuuid.BufferClass(16);
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v4('binary', buffer);
+  rate('nodeuuid.v4(\'binary\', buffer)', t);
+}
+
+// libuuid - string form
+if (uuid) {
+  for (var i = 0, t = Date.now(); i < N; i++) uuid();
+  rate('uuid()', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) uuid('binary');
+  rate('uuid(\'binary\')', t);
+}
+
+// uuid-js - string form
+if (uuidjs) {
+  for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(4);
+  rate('uuidjs.create(4)', t);
+}
+
+// 140byte.es
+for (var i = 0, t = Date.now(); i < N; i++) 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g,function(s,r){r=Math.random()*16|0;return (s=='x'?r:r&0x3|0x8).toString(16)});
+rate('140byte.es_v4', t);
+
+console.log('');
+console.log('# v1');
+
+// node-uuid - v1 string form
+if (nodeuuid) {
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1();
+  rate('nodeuuid.v1()', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary');
+  rate('nodeuuid.v1(\'binary\')', t);
+
+  var buffer = new nodeuuid.BufferClass(16);
+  for (var i = 0, t = Date.now(); i < N; i++) nodeuuid.v1('binary', buffer);
+  rate('nodeuuid.v1(\'binary\', buffer)', t);
+}
+
+// uuid-js - v1 string form
+if (uuidjs) {
+  for (var i = 0, t = Date.now(); i < N; i++) uuidjs.create(1);
+  rate('uuidjs.create(1)', t);
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/component.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/component.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/component.json	(revision 487)
@@ -0,0 +1,18 @@
+{
+  "name": "node-uuid",
+  "repo": "broofa/node-uuid",
+  "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+  "version": "1.4.0",
+  "author": "Robert Kieffer <robert@broofa.com>",
+  "contributors": [
+    {"name": "Christoph Tavan <dev@tavan.de>", "github": "https://github.com/ctavan"}
+  ],
+  "keywords": ["uuid", "guid", "rfc4122"],
+  "dependencies": {},
+  "development": {},
+  "main": "uuid.js",
+  "scripts": [
+    "uuid.js"
+  ],
+  "license": "MIT"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/package.json	(revision 487)
@@ -0,0 +1,35 @@
+{
+  "name": "node-uuid",
+  "description": "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.",
+  "url": "http://github.com/broofa/node-uuid",
+  "keywords": [
+    "uuid",
+    "guid",
+    "rfc4122"
+  ],
+  "author": {
+    "name": "Robert Kieffer",
+    "email": "robert@broofa.com"
+  },
+  "contributors": [
+    {
+      "name": "Christoph Tavan",
+      "email": "dev@tavan.de"
+    }
+  ],
+  "lib": ".",
+  "main": "./uuid.js",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/broofa/node-uuid.git"
+  },
+  "version": "1.4.1",
+  "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation on supporting platforms\n* 1.1K minified and gzip'ed  (Want something smaller?  Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n<script src=\"uuid.js\"></script>\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n  * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID.  See note 1.\n  * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence.  Default: An internally maintained clockseq is used.\n  * `msecs` - (Number | Date) Time in milliseconds since unix Epoch.  Default: The current time is used.\n  * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n  node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n  clockseq: 0x1234,\n  msecs: new Date('2011-11-01').getTime(),\n  nsecs: 5678\n});   // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0);   // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.v1(null, arr, 16);  // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer);    // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n  * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n  * `rng` - (Function) Random # generator to use.  Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n  random: [\n    0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n    0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n  ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n  * `id` - (String) UUID(-like) string\n  * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n  * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>\nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary).\n\n### uuid.BufferClass\n\nThe class of container created when generating binary uuid data if no buffer argument is specified.  This is expected to go away, with no replacement API.\n\n## Testing\n\nIn node.js\n\n```\n> cd test\n> node test.js\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/broofa/node-uuid/issues"
+  },
+  "homepage": "https://github.com/broofa/node-uuid",
+  "_id": "node-uuid@1.4.1",
+  "_from": "node-uuid@~1.4.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/compare_v1.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/compare_v1.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/compare_v1.js	(revision 487)
@@ -0,0 +1,63 @@
+var assert = require('assert'),
+    nodeuuid = require('../uuid'),
+    uuidjs = require('uuid-js'),
+    libuuid = require('uuid').generate,
+    util = require('util'),
+    exec = require('child_process').exec,
+    os = require('os');
+
+// On Mac Os X / macports there's only the ossp-uuid package that provides uuid
+// On Linux there's uuid-runtime which provides uuidgen
+var uuidCmd = os.type() === 'Darwin' ? 'uuid -1' : 'uuidgen -t';
+
+function compare(ids) {
+  console.log(ids);
+  for (var i = 0; i < ids.length; i++) {
+    var id = ids[i].split('-');
+    id = [id[2], id[1], id[0]].join('');
+    ids[i] = id;
+  }
+  var sorted = ([].concat(ids)).sort();
+
+  if (sorted.toString() !== ids.toString()) {
+    console.log('Warning: sorted !== ids');
+  } else {
+    console.log('everything in order!');
+  }
+}
+
+// Test time order of v1 uuids
+var ids = [];
+while (ids.length < 10e3) ids.push(nodeuuid.v1());
+
+var max = 10;
+console.log('node-uuid:');
+ids = [];
+for (var i = 0; i < max; i++) ids.push(nodeuuid.v1());
+compare(ids);
+
+console.log('');
+console.log('uuidjs:');
+ids = [];
+for (var i = 0; i < max; i++) ids.push(uuidjs.create(1).toString());
+compare(ids);
+
+console.log('');
+console.log('libuuid:');
+ids = [];
+var count = 0;
+var last = function() {
+  compare(ids);
+}
+var cb = function(err, stdout, stderr) {
+  ids.push(stdout.substring(0, stdout.length-1));
+  count++;
+  if (count < max) {
+    return next();
+  }
+  last();
+};
+var next = function() {
+  exec(uuidCmd, cb);
+};
+next();
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/test.html
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/test.html	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/test.html	(revision 487)
@@ -0,0 +1,17 @@
+<html>
+  <head>
+    <style>
+      div {
+        font-family: monospace;
+        font-size: 8pt;
+      }
+      div.log {color: #444;}
+      div.warn {color: #550;}
+      div.error {color: #800; font-weight: bold;}
+    </style>
+    <script src="../uuid.js"></script>
+  </head>
+  <body>
+    <script src="./test.js"></script>
+  </body>
+</html>
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/test.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/test.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/test/test.js	(revision 487)
@@ -0,0 +1,228 @@
+if (!this.uuid) {
+  // node.js
+  uuid = require('../uuid');
+}
+
+//
+// x-platform log/assert shims
+//
+
+function _log(msg, type) {
+  type = type || 'log';
+
+  if (typeof(document) != 'undefined') {
+    document.write('<div class="' + type + '">' + msg.replace(/\n/g, '<br />') + '</div>');
+  }
+  if (typeof(console) != 'undefined') {
+    var color = {
+      log: '\033[39m',
+      warn: '\033[33m',
+      error: '\033[31m'
+    };
+    console[type](color[type] + msg + color.log);
+  }
+}
+
+function log(msg) {_log(msg, 'log');}
+function warn(msg) {_log(msg, 'warn');}
+function error(msg) {_log(msg, 'error');}
+
+function assert(res, msg) {
+  if (!res) {
+    error('FAIL: ' + msg);
+  } else {
+    log('Pass: ' + msg);
+  }
+}
+
+//
+// Unit tests
+//
+
+// Verify ordering of v1 ids created with explicit times
+var TIME = 1321644961388; // 2011-11-18 11:36:01.388-08:00
+
+function compare(name, ids) {
+  ids = ids.map(function(id) {
+    return id.split('-').reverse().join('-');
+  }).sort();
+  var sorted = ([].concat(ids)).sort();
+
+  assert(sorted.toString() == ids.toString(), name + ' have expected order');
+}
+
+// Verify ordering of v1 ids created using default behavior
+compare('uuids with current time', [
+  uuid.v1(),
+  uuid.v1(),
+  uuid.v1(),
+  uuid.v1(),
+  uuid.v1()
+]);
+
+// Verify ordering of v1 ids created with explicit times
+compare('uuids with time option', [
+  uuid.v1({msecs: TIME - 10*3600*1000}),
+  uuid.v1({msecs: TIME - 1}),
+  uuid.v1({msecs: TIME}),
+  uuid.v1({msecs: TIME + 1}),
+  uuid.v1({msecs: TIME + 28*24*3600*1000})
+]);
+
+assert(
+  uuid.v1({msecs: TIME}) != uuid.v1({msecs: TIME}),
+  'IDs created at same msec are different'
+);
+
+// Verify throw if too many ids created
+var thrown = false;
+try {
+  uuid.v1({msecs: TIME, nsecs: 10000});
+} catch (e) {
+  thrown = true;
+}
+assert(thrown, 'Exception thrown when > 10K ids created in 1 ms');
+
+// Verify clock regression bumps clockseq
+var uidt = uuid.v1({msecs: TIME});
+var uidtb = uuid.v1({msecs: TIME - 1});
+assert(
+  parseInt(uidtb.split('-')[3], 16) - parseInt(uidt.split('-')[3], 16) === 1,
+  'Clock regression by msec increments the clockseq'
+);
+
+// Verify clock regression bumps clockseq
+var uidtn = uuid.v1({msecs: TIME, nsecs: 10});
+var uidtnb = uuid.v1({msecs: TIME, nsecs: 9});
+assert(
+  parseInt(uidtnb.split('-')[3], 16) - parseInt(uidtn.split('-')[3], 16) === 1,
+  'Clock regression by nsec increments the clockseq'
+);
+
+// Verify explicit options produce expected id
+var id = uuid.v1({
+  msecs: 1321651533573,
+  nsecs: 5432,
+  clockseq: 0x385c,
+  node: [ 0x61, 0xcd, 0x3c, 0xbb, 0x32, 0x10 ]
+});
+assert(id == 'd9428888-122b-11e1-b85c-61cd3cbb3210', 'Explicit options produce expected id');
+
+// Verify adjacent ids across a msec boundary are 1 time unit apart
+var u0 = uuid.v1({msecs: TIME, nsecs: 9999});
+var u1 = uuid.v1({msecs: TIME + 1, nsecs: 0});
+
+var before = u0.split('-')[0], after = u1.split('-')[0];
+var dt = parseInt(after, 16) - parseInt(before, 16);
+assert(dt === 1, 'Ids spanning 1ms boundary are 100ns apart');
+
+//
+// Test parse/unparse
+//
+
+id = '00112233445566778899aabbccddeeff';
+assert(uuid.unparse(uuid.parse(id.substr(0,10))) ==
+  '00112233-4400-0000-0000-000000000000', 'Short parse');
+assert(uuid.unparse(uuid.parse('(this is the uuid -> ' + id + id)) ==
+  '00112233-4455-6677-8899-aabbccddeeff', 'Dirty parse');
+
+//
+// Perf tests
+//
+
+var generators = {
+  v1: uuid.v1,
+  v4: uuid.v4
+};
+
+var UUID_FORMAT = {
+  v1: /[0-9a-f]{8}-[0-9a-f]{4}-1[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i,
+  v4: /[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}/i
+};
+
+var N = 1e4;
+
+// Get %'age an actual value differs from the ideal value
+function divergence(actual, ideal) {
+  return Math.round(100*100*(actual - ideal)/ideal)/100;
+}
+
+function rate(msg, t) {
+  log(msg + ': ' + (N / (Date.now() - t) * 1e3 | 0) + ' uuids\/second');
+}
+
+for (var version in generators) {
+  var counts = {}, max = 0;
+  var generator = generators[version];
+  var format = UUID_FORMAT[version];
+
+  log('\nSanity check ' + N + ' ' + version + ' uuids');
+  for (var i = 0, ok = 0; i < N; i++) {
+    id = generator();
+    if (!format.test(id)) {
+      throw Error(id + ' is not a valid UUID string');
+    }
+
+    if (id != uuid.unparse(uuid.parse(id))) {
+      assert(fail, id + ' is not a valid id');
+    }
+
+    // Count digits for our randomness check
+    if (version == 'v4') {
+      var digits = id.replace(/-/g, '').split('');
+      for (var j = digits.length-1; j >= 0; j--) {
+        var c = digits[j];
+        max = Math.max(max, counts[c] = (counts[c] || 0) + 1);
+      }
+    }
+  }
+
+  // Check randomness for v4 UUIDs
+  if (version == 'v4') {
+    // Limit that we get worried about randomness. (Purely empirical choice, this!)
+    var limit = 2*100*Math.sqrt(1/N);
+
+    log('\nChecking v4 randomness.  Distribution of Hex Digits (% deviation from ideal)');
+
+    for (var i = 0; i < 16; i++) {
+      var c = i.toString(16);
+      var bar = '', n = counts[c], p = Math.round(n/max*100|0);
+
+      // 1-3,5-8, and D-F: 1:16 odds over 30 digits
+      var ideal = N*30/16;
+      if (i == 4) {
+        // 4: 1:1 odds on 1 digit, plus 1:16 odds on 30 digits
+        ideal = N*(1 + 30/16);
+      } else if (i >= 8 && i <= 11) {
+        // 8-B: 1:4 odds on 1 digit, plus 1:16 odds on 30 digits
+        ideal = N*(1/4 + 30/16);
+      } else {
+        // Otherwise: 1:16 odds on 30 digits
+        ideal = N*30/16;
+      }
+      var d = divergence(n, ideal);
+
+      // Draw bar using UTF squares (just for grins)
+      var s = n/max*50 | 0;
+      while (s--) bar += '=';
+
+      assert(Math.abs(d) < limit, c + ' |' + bar + '| ' + counts[c] + ' (' + d + '% < ' + limit + '%)');
+    }
+  }
+}
+
+// Perf tests
+for (var version in generators) {
+  log('\nPerformance testing ' + version + ' UUIDs');
+  var generator = generators[version];
+  var buf = new uuid.BufferClass(16);
+
+  for (var i = 0, t = Date.now(); i < N; i++) generator();
+  rate('uuid.' + version + '()', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) generator('binary');
+  rate('uuid.' + version + '(\'binary\')', t);
+
+  for (var i = 0, t = Date.now(); i < N; i++) generator('binary', buf);
+  rate('uuid.' + version + '(\'binary\', buffer)', t);
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/uuid.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/uuid.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/node-uuid/uuid.js	(revision 487)
@@ -0,0 +1,245 @@
+//     uuid.js
+//
+//     Copyright (c) 2010-2012 Robert Kieffer
+//     MIT License - http://opensource.org/licenses/mit-license.php
+
+(function() {
+  var _global = this;
+
+  // Unique ID creation requires a high quality random # generator.  We feature
+  // detect to determine the best RNG source, normalizing to a function that
+  // returns 128-bits of randomness, since that's what's usually required
+  var _rng;
+
+  // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html
+  //
+  // Moderately fast, high quality
+  if (typeof(require) == 'function') {
+    try {
+      var _rb = require('crypto').randomBytes;
+      _rng = _rb && function() {return _rb(16);};
+    } catch(e) {}
+  }
+
+  if (!_rng && _global.crypto && crypto.getRandomValues) {
+    // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto
+    //
+    // Moderately fast, high quality
+    var _rnds8 = new Uint8Array(16);
+    _rng = function whatwgRNG() {
+      crypto.getRandomValues(_rnds8);
+      return _rnds8;
+    };
+  }
+
+  if (!_rng) {
+    // Math.random()-based (RNG)
+    //
+    // If all else fails, use Math.random().  It's fast, but is of unspecified
+    // quality.
+    var  _rnds = new Array(16);
+    _rng = function() {
+      for (var i = 0, r; i < 16; i++) {
+        if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
+        _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
+      }
+
+      return _rnds;
+    };
+  }
+
+  // Buffer class to use
+  var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array;
+
+  // Maps for number <-> hex string conversion
+  var _byteToHex = [];
+  var _hexToByte = {};
+  for (var i = 0; i < 256; i++) {
+    _byteToHex[i] = (i + 0x100).toString(16).substr(1);
+    _hexToByte[_byteToHex[i]] = i;
+  }
+
+  // **`parse()` - Parse a UUID into it's component bytes**
+  function parse(s, buf, offset) {
+    var i = (buf && offset) || 0, ii = 0;
+
+    buf = buf || [];
+    s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {
+      if (ii < 16) { // Don't overflow!
+        buf[i + ii++] = _hexToByte[oct];
+      }
+    });
+
+    // Zero out remaining bytes if string was short
+    while (ii < 16) {
+      buf[i + ii++] = 0;
+    }
+
+    return buf;
+  }
+
+  // **`unparse()` - Convert UUID byte array (ala parse()) into a string**
+  function unparse(buf, offset) {
+    var i = offset || 0, bth = _byteToHex;
+    return  bth[buf[i++]] + bth[buf[i++]] +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] + '-' +
+            bth[buf[i++]] + bth[buf[i++]] +
+            bth[buf[i++]] + bth[buf[i++]] +
+            bth[buf[i++]] + bth[buf[i++]];
+  }
+
+  // **`v1()` - Generate time-based UUID**
+  //
+  // Inspired by https://github.com/LiosK/UUID.js
+  // and http://docs.python.org/library/uuid.html
+
+  // random #'s we need to init node and clockseq
+  var _seedBytes = _rng();
+
+  // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
+  var _nodeId = [
+    _seedBytes[0] | 0x01,
+    _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]
+  ];
+
+  // Per 4.2.2, randomize (14 bit) clockseq
+  var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;
+
+  // Previous uuid creation time
+  var _lastMSecs = 0, _lastNSecs = 0;
+
+  // See https://github.com/broofa/node-uuid for API details
+  function v1(options, buf, offset) {
+    var i = buf && offset || 0;
+    var b = buf || [];
+
+    options = options || {};
+
+    var clockseq = options.clockseq != null ? options.clockseq : _clockseq;
+
+    // UUID timestamps are 100 nano-second units since the Gregorian epoch,
+    // (1582-10-15 00:00).  JSNumbers aren't precise enough for this, so
+    // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
+    // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
+    var msecs = options.msecs != null ? options.msecs : new Date().getTime();
+
+    // Per 4.2.1.2, use count of uuid's generated during the current clock
+    // cycle to simulate higher resolution clock
+    var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
+
+    // Time since last uuid creation (in msecs)
+    var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
+
+    // Per 4.2.1.2, Bump clockseq on clock regression
+    if (dt < 0 && options.clockseq == null) {
+      clockseq = clockseq + 1 & 0x3fff;
+    }
+
+    // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
+    // time interval
+    if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) {
+      nsecs = 0;
+    }
+
+    // Per 4.2.1.2 Throw error if too many uuids are requested
+    if (nsecs >= 10000) {
+      throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+    }
+
+    _lastMSecs = msecs;
+    _lastNSecs = nsecs;
+    _clockseq = clockseq;
+
+    // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
+    msecs += 12219292800000;
+
+    // `time_low`
+    var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
+    b[i++] = tl >>> 24 & 0xff;
+    b[i++] = tl >>> 16 & 0xff;
+    b[i++] = tl >>> 8 & 0xff;
+    b[i++] = tl & 0xff;
+
+    // `time_mid`
+    var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
+    b[i++] = tmh >>> 8 & 0xff;
+    b[i++] = tmh & 0xff;
+
+    // `time_high_and_version`
+    b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
+    b[i++] = tmh >>> 16 & 0xff;
+
+    // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
+    b[i++] = clockseq >>> 8 | 0x80;
+
+    // `clock_seq_low`
+    b[i++] = clockseq & 0xff;
+
+    // `node`
+    var node = options.node || _nodeId;
+    for (var n = 0; n < 6; n++) {
+      b[i + n] = node[n];
+    }
+
+    return buf ? buf : unparse(b);
+  }
+
+  // **`v4()` - Generate random UUID**
+
+  // See https://github.com/broofa/node-uuid for API details
+  function v4(options, buf, offset) {
+    // Deprecated - 'format' argument, as supported in v1.2
+    var i = buf && offset || 0;
+
+    if (typeof(options) == 'string') {
+      buf = options == 'binary' ? new BufferClass(16) : null;
+      options = null;
+    }
+    options = options || {};
+
+    var rnds = options.random || (options.rng || _rng)();
+
+    // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
+    rnds[6] = (rnds[6] & 0x0f) | 0x40;
+    rnds[8] = (rnds[8] & 0x3f) | 0x80;
+
+    // Copy bytes to buffer, if provided
+    if (buf) {
+      for (var ii = 0; ii < 16; ii++) {
+        buf[i + ii] = rnds[ii];
+      }
+    }
+
+    return buf || unparse(rnds);
+  }
+
+  // Export public API
+  var uuid = v4;
+  uuid.v1 = v1;
+  uuid.v4 = v4;
+  uuid.parse = parse;
+  uuid.unparse = unparse;
+  uuid.BufferClass = BufferClass;
+
+  if (typeof define === 'function' && define.amd) {
+    // Publish as AMD module
+    define(function() {return uuid;});
+  } else if (typeof(module) != 'undefined' && module.exports) {
+    // Publish as node.js module
+    module.exports = uuid;
+  } else {
+    // Publish as global (in browsers)
+    var _previousRoot = _global.uuid;
+
+    // **`noConflict()` - (browser only) to reset global 'uuid' var**
+    uuid.noConflict = function() {
+      _global.uuid = _previousRoot;
+      return uuid;
+    };
+
+    _global.uuid = uuid;
+  }
+}).call(this);
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/LICENSE	(revision 487)
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/README.md	(revision 487)
@@ -0,0 +1,4 @@
+oauth-sign
+==========
+
+OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. 
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/index.js	(revision 487)
@@ -0,0 +1,43 @@
+var crypto = require('crypto')
+  , qs = require('querystring')
+  ;
+
+function sha1 (key, body) {
+  return crypto.createHmac('sha1', key).update(body).digest('base64')
+}
+
+function rfc3986 (str) {
+  return encodeURIComponent(str)
+    .replace(/!/g,'%21')
+    .replace(/\*/g,'%2A')
+    .replace(/\(/g,'%28')
+    .replace(/\)/g,'%29')
+    .replace(/'/g,'%27')
+    ;
+}
+
+function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
+  // adapted from https://dev.twitter.com/docs/auth/oauth and 
+  // https://dev.twitter.com/docs/auth/creating-signature
+
+  var querystring = Object.keys(params).sort().map(function(key){
+    // big WTF here with the escape + encoding but it's what twitter wants
+    return escape(rfc3986(key)) + "%3D" + escape(rfc3986(params[key]))
+  }).join('%26')
+
+  var base = [
+    httpMethod ? httpMethod.toUpperCase() : 'GET',
+    rfc3986(base_uri),
+    querystring
+  ].join('&')
+
+  var key = [
+    consumer_secret,
+    token_secret || ''
+  ].map(rfc3986).join('&')
+
+  return sha1(key, base)
+}
+
+exports.hmacsign = hmacsign
+exports.rfc3986 = rfc3986
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/package.json	(revision 487)
@@ -0,0 +1,31 @@
+{
+  "author": {
+    "name": "Mikeal Rogers",
+    "email": "mikeal.rogers@gmail.com",
+    "url": "http://www.futurealoof.com"
+  },
+  "name": "oauth-sign",
+  "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
+  "version": "0.3.0",
+  "repository": {
+    "url": "https://github.com/mikeal/oauth-sign"
+  },
+  "main": "index.js",
+  "dependencies": {},
+  "devDependencies": {},
+  "optionalDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "readme": "oauth-sign\n==========\n\nOAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. \n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/mikeal/oauth-sign/issues"
+  },
+  "homepage": "https://github.com/mikeal/oauth-sign",
+  "_id": "oauth-sign@0.3.0",
+  "_from": "oauth-sign@~0.3.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/test.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/test.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/oauth-sign/test.js	(revision 487)
@@ -0,0 +1,49 @@
+var hmacsign = require('./index').hmacsign
+  , assert = require('assert')
+  , qs = require('querystring')
+  ;
+
+// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth
+
+var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', 
+  { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11'
+  , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
+  , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk'
+  , oauth_signature_method: 'HMAC-SHA1'
+  , oauth_timestamp: '1272323042'
+  , oauth_version: '1.0'
+  }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98")
+
+console.log(reqsign)
+console.log('8wUi7m5HFQy76nowoCThusfgB+Q=')
+assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=')
+
+var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token',
+  { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
+  , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8'
+  , oauth_signature_method: 'HMAC-SHA1'
+  , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc'
+  , oauth_timestamp: '1272323047'
+  , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY'
+  , oauth_version: '1.0'
+  }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA")
+  
+console.log(accsign)
+console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
+assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
+
+var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', 
+  { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g"
+  , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y"
+  , oauth_signature_method: "HMAC-SHA1"
+  , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw"
+  , oauth_timestamp: "1272325550"
+  , oauth_version: "1.0"
+  , status: 'setting up my twitter ç§ã®ãããããèš­å®ãã'
+  }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA")
+
+console.log(upsign)
+console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/.gitmodules
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/.gitmodules	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/.gitmodules	(revision 487)
@@ -0,0 +1,6 @@
+[submodule "support/expresso"]
+	path = support/expresso
+	url = git://github.com/visionmedia/expresso.git
+[submodule "support/should"]
+	path = support/should
+	url = git://github.com/visionmedia/should.js.git
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/.npmignore
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/.npmignore	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/.npmignore	(revision 487)
@@ -0,0 +1,7 @@
+test
+.travis.yml
+benchmark.js
+component.json
+examples.js
+History.md
+Makefile
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/Readme.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/Readme.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/Readme.md	(revision 487)
@@ -0,0 +1,58 @@
+# node-querystring
+
+  query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.
+
+## Installation
+
+    $ npm install qs
+
+## Examples
+
+```js
+var qs = require('qs');
+
+qs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');
+// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }
+
+qs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})
+// => user[name]=Tobi&user[email]=tobi%40learnboost.com
+```
+
+## Testing
+
+Install dev dependencies:
+
+    $ npm install -d
+
+and execute:
+
+    $ make test
+
+browser:
+
+    $ open test/browser/index.html
+
+## License 
+
+(The MIT License)
+
+Copyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+'Software'), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/index.js	(revision 487)
@@ -0,0 +1,366 @@
+/**
+ * Object#toString() ref for stringify().
+ */
+
+var toString = Object.prototype.toString;
+
+/**
+ * Object#hasOwnProperty ref
+ */
+
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+/**
+ * Array#indexOf shim.
+ */
+
+var indexOf = typeof Array.prototype.indexOf === 'function'
+  ? function(arr, el) { return arr.indexOf(el); }
+  : function(arr, el) {
+      for (var i = 0; i < arr.length; i++) {
+        if (arr[i] === el) return i;
+      }
+      return -1;
+    };
+
+/**
+ * Array.isArray shim.
+ */
+
+var isArray = Array.isArray || function(arr) {
+  return toString.call(arr) == '[object Array]';
+};
+
+/**
+ * Object.keys shim.
+ */
+
+var objectKeys = Object.keys || function(obj) {
+  var ret = [];
+  for (var key in obj) {
+    if (obj.hasOwnProperty(key)) {
+      ret.push(key);
+    }
+  }
+  return ret;
+};
+
+/**
+ * Array#forEach shim.
+ */
+
+var forEach = typeof Array.prototype.forEach === 'function'
+  ? function(arr, fn) { return arr.forEach(fn); }
+  : function(arr, fn) {
+      for (var i = 0; i < arr.length; i++) fn(arr[i]);
+    };
+
+/**
+ * Array#reduce shim.
+ */
+
+var reduce = function(arr, fn, initial) {
+  if (typeof arr.reduce === 'function') return arr.reduce(fn, initial);
+  var res = initial;
+  for (var i = 0; i < arr.length; i++) res = fn(res, arr[i]);
+  return res;
+};
+
+/**
+ * Cache non-integer test regexp.
+ */
+
+var isint = /^[0-9]+$/;
+
+function promote(parent, key) {
+  if (parent[key].length == 0) return parent[key] = {}
+  var t = {};
+  for (var i in parent[key]) {
+    if (hasOwnProperty.call(parent[key], i)) {
+      t[i] = parent[key][i];
+    }
+  }
+  parent[key] = t;
+  return t;
+}
+
+function parse(parts, parent, key, val) {
+  var part = parts.shift();
+  
+  // illegal
+  if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return;
+  
+  // end
+  if (!part) {
+    if (isArray(parent[key])) {
+      parent[key].push(val);
+    } else if ('object' == typeof parent[key]) {
+      parent[key] = val;
+    } else if ('undefined' == typeof parent[key]) {
+      parent[key] = val;
+    } else {
+      parent[key] = [parent[key], val];
+    }
+    // array
+  } else {
+    var obj = parent[key] = parent[key] || [];
+    if (']' == part) {
+      if (isArray(obj)) {
+        if ('' != val) obj.push(val);
+      } else if ('object' == typeof obj) {
+        obj[objectKeys(obj).length] = val;
+      } else {
+        obj = parent[key] = [parent[key], val];
+      }
+      // prop
+    } else if (~indexOf(part, ']')) {
+      part = part.substr(0, part.length - 1);
+      if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
+      parse(parts, obj, part, val);
+      // key
+    } else {
+      if (!isint.test(part) && isArray(obj)) obj = promote(parent, key);
+      parse(parts, obj, part, val);
+    }
+  }
+}
+
+/**
+ * Merge parent key/val pair.
+ */
+
+function merge(parent, key, val){
+  if (~indexOf(key, ']')) {
+    var parts = key.split('[')
+      , len = parts.length
+      , last = len - 1;
+    parse(parts, parent, 'base', val);
+    // optimize
+  } else {
+    if (!isint.test(key) && isArray(parent.base)) {
+      var t = {};
+      for (var k in parent.base) t[k] = parent.base[k];
+      parent.base = t;
+    }
+    set(parent.base, key, val);
+  }
+
+  return parent;
+}
+
+/**
+ * Compact sparse arrays.
+ */
+
+function compact(obj) {
+  if ('object' != typeof obj) return obj;
+
+  if (isArray(obj)) {
+    var ret = [];
+
+    for (var i in obj) {
+      if (hasOwnProperty.call(obj, i)) {
+        ret.push(obj[i]);
+      }
+    }
+
+    return ret;
+  }
+
+  for (var key in obj) {
+    obj[key] = compact(obj[key]);
+  }
+
+  return obj;
+}
+
+/**
+ * Parse the given obj.
+ */
+
+function parseObject(obj){
+  var ret = { base: {} };
+
+  forEach(objectKeys(obj), function(name){
+    merge(ret, name, obj[name]);
+  });
+
+  return compact(ret.base);
+}
+
+/**
+ * Parse the given str.
+ */
+
+function parseString(str){
+  var ret = reduce(String(str).split('&'), function(ret, pair){
+    var eql = indexOf(pair, '=')
+      , brace = lastBraceInKey(pair)
+      , key = pair.substr(0, brace || eql)
+      , val = pair.substr(brace || eql, pair.length)
+      , val = val.substr(indexOf(val, '=') + 1, val.length);
+
+    // ?foo
+    if ('' == key) key = pair, val = '';
+    if ('' == key) return ret;
+
+    return merge(ret, decode(key), decode(val));
+  }, { base: {} }).base;
+
+  return compact(ret);
+}
+
+/**
+ * Parse the given query `str` or `obj`, returning an object.
+ *
+ * @param {String} str | {Object} obj
+ * @return {Object}
+ * @api public
+ */
+
+exports.parse = function(str){
+  if (null == str || '' == str) return {};
+  return 'object' == typeof str
+    ? parseObject(str)
+    : parseString(str);
+};
+
+/**
+ * Turn the given `obj` into a query string
+ *
+ * @param {Object} obj
+ * @return {String}
+ * @api public
+ */
+
+var stringify = exports.stringify = function(obj, prefix) {
+  if (isArray(obj)) {
+    return stringifyArray(obj, prefix);
+  } else if ('[object Object]' == toString.call(obj)) {
+    return stringifyObject(obj, prefix);
+  } else if ('string' == typeof obj) {
+    return stringifyString(obj, prefix);
+  } else {
+    return prefix + '=' + encodeURIComponent(String(obj));
+  }
+};
+
+/**
+ * Stringify the given `str`.
+ *
+ * @param {String} str
+ * @param {String} prefix
+ * @return {String}
+ * @api private
+ */
+
+function stringifyString(str, prefix) {
+  if (!prefix) throw new TypeError('stringify expects an object');
+  return prefix + '=' + encodeURIComponent(str);
+}
+
+/**
+ * Stringify the given `arr`.
+ *
+ * @param {Array} arr
+ * @param {String} prefix
+ * @return {String}
+ * @api private
+ */
+
+function stringifyArray(arr, prefix) {
+  var ret = [];
+  if (!prefix) throw new TypeError('stringify expects an object');
+  for (var i = 0; i < arr.length; i++) {
+    ret.push(stringify(arr[i], prefix + '[' + i + ']'));
+  }
+  return ret.join('&');
+}
+
+/**
+ * Stringify the given `obj`.
+ *
+ * @param {Object} obj
+ * @param {String} prefix
+ * @return {String}
+ * @api private
+ */
+
+function stringifyObject(obj, prefix) {
+  var ret = []
+    , keys = objectKeys(obj)
+    , key;
+
+  for (var i = 0, len = keys.length; i < len; ++i) {
+    key = keys[i];
+    if ('' == key) continue;
+    if (null == obj[key]) {
+      ret.push(encodeURIComponent(key) + '=');
+    } else {
+      ret.push(stringify(obj[key], prefix
+        ? prefix + '[' + encodeURIComponent(key) + ']'
+        : encodeURIComponent(key)));
+    }
+  }
+
+  return ret.join('&');
+}
+
+/**
+ * Set `obj`'s `key` to `val` respecting
+ * the weird and wonderful syntax of a qs,
+ * where "foo=bar&foo=baz" becomes an array.
+ *
+ * @param {Object} obj
+ * @param {String} key
+ * @param {String} val
+ * @api private
+ */
+
+function set(obj, key, val) {
+  var v = obj[key];
+  if (Object.getOwnPropertyDescriptor(Object.prototype, key)) return;
+  if (undefined === v) {
+    obj[key] = val;
+  } else if (isArray(v)) {
+    v.push(val);
+  } else {
+    obj[key] = [v, val];
+  }
+}
+
+/**
+ * Locate last brace in `str` within the key.
+ *
+ * @param {String} str
+ * @return {Number}
+ * @api private
+ */
+
+function lastBraceInKey(str) {
+  var len = str.length
+    , brace
+    , c;
+  for (var i = 0; i < len; ++i) {
+    c = str[i];
+    if (']' == c) brace = false;
+    if ('[' == c) brace = true;
+    if ('=' == c && !brace) return i;
+  }
+}
+
+/**
+ * Decode `str`.
+ *
+ * @param {String} str
+ * @return {String}
+ * @api private
+ */
+
+function decode(str) {
+  try {
+    return decodeURIComponent(str.replace(/\+/g, ' '));
+  } catch (err) {
+    return str;
+  }
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/qs/package.json	(revision 487)
@@ -0,0 +1,42 @@
+{
+  "name": "qs",
+  "description": "querystring parser",
+  "version": "0.6.6",
+  "keywords": [
+    "query string",
+    "parser",
+    "component"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/visionmedia/node-querystring.git"
+  },
+  "devDependencies": {
+    "mocha": "*",
+    "expect.js": "*"
+  },
+  "scripts": {
+    "test": "make test"
+  },
+  "author": {
+    "name": "TJ Holowaychuk",
+    "email": "tj@vision-media.ca",
+    "url": "http://tjholowaychuk.com"
+  },
+  "main": "index",
+  "engines": {
+    "node": "*"
+  },
+  "readme": "# node-querystring\n\n  query string parser for node and the browser supporting nesting, as it was removed from `0.3.x`, so this library provides the previous and commonly desired behaviour (and twice as fast). Used by [express](http://expressjs.com), [connect](http://senchalabs.github.com/connect) and others.\n\n## Installation\n\n    $ npm install qs\n\n## Examples\n\n```js\nvar qs = require('qs');\n\nqs.parse('user[name][first]=Tobi&user[email]=tobi@learnboost.com');\n// => { user: { name: { first: 'Tobi' }, email: 'tobi@learnboost.com' } }\n\nqs.stringify({ user: { name: 'Tobi', email: 'tobi@learnboost.com' }})\n// => user[name]=Tobi&user[email]=tobi%40learnboost.com\n```\n\n## Testing\n\nInstall dev dependencies:\n\n    $ npm install -d\n\nand execute:\n\n    $ make test\n\nbrowser:\n\n    $ open test/browser/index.html\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2010 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
+  "readmeFilename": "Readme.md",
+  "bugs": {
+    "url": "https://github.com/visionmedia/node-querystring/issues"
+  },
+  "homepage": "https://github.com/visionmedia/node-querystring",
+  "_id": "qs@0.6.6",
+  "dist": {
+    "shasum": "9273308fc9b808b041bb75e632cbf82fe83b45fd"
+  },
+  "_from": "qs@~0.6.0",
+  "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.6.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/LICENSE
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/LICENSE	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/LICENSE	(revision 487)
@@ -0,0 +1,55 @@
+Apache License
+
+Version 2.0, January 2004
+
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/README.md	(revision 487)
@@ -0,0 +1,4 @@
+tunnel-agent
+============
+
+HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/index.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/index.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/index.js	(revision 487)
@@ -0,0 +1,227 @@
+'use strict'
+
+var net = require('net')
+  , tls = require('tls')
+  , http = require('http')
+  , https = require('https')
+  , events = require('events')
+  , assert = require('assert')
+  , util = require('util')
+  ;
+
+exports.httpOverHttp = httpOverHttp
+exports.httpsOverHttp = httpsOverHttp
+exports.httpOverHttps = httpOverHttps
+exports.httpsOverHttps = httpsOverHttps
+
+
+function httpOverHttp(options) {
+  var agent = new TunnelingAgent(options)
+  agent.request = http.request
+  return agent
+}
+
+function httpsOverHttp(options) {
+  var agent = new TunnelingAgent(options)
+  agent.request = http.request
+  agent.createSocket = createSecureSocket
+  return agent
+}
+
+function httpOverHttps(options) {
+  var agent = new TunnelingAgent(options)
+  agent.request = https.request
+  return agent
+}
+
+function httpsOverHttps(options) {
+  var agent = new TunnelingAgent(options)
+  agent.request = https.request
+  agent.createSocket = createSecureSocket
+  return agent
+}
+
+
+function TunnelingAgent(options) {
+  var self = this
+  self.options = options || {}
+  self.proxyOptions = self.options.proxy || {}
+  self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
+  self.requests = []
+  self.sockets = []
+
+  self.on('free', function onFree(socket, host, port) {
+    for (var i = 0, len = self.requests.length; i < len; ++i) {
+      var pending = self.requests[i]
+      if (pending.host === host && pending.port === port) {
+        // Detect the request to connect same origin server,
+        // reuse the connection.
+        self.requests.splice(i, 1)
+        pending.request.onSocket(socket)
+        return
+      }
+    }
+    socket.destroy()
+    self.removeSocket(socket)
+  })
+}
+util.inherits(TunnelingAgent, events.EventEmitter)
+
+TunnelingAgent.prototype.addRequest = function addRequest(req, host, port) {
+  var self = this
+
+  if (self.sockets.length >= this.maxSockets) {
+    // We are over limit so we'll add it to the queue.
+    self.requests.push({host: host, port: port, request: req})
+    return
+  }
+
+  // If we are under maxSockets create a new one.
+  self.createSocket({host: host, port: port, request: req}, function(socket) {
+    socket.on('free', onFree)
+    socket.on('close', onCloseOrRemove)
+    socket.on('agentRemove', onCloseOrRemove)
+    req.onSocket(socket)
+
+    function onFree() {
+      self.emit('free', socket, host, port)
+    }
+
+    function onCloseOrRemove(err) {
+      self.removeSocket()
+      socket.removeListener('free', onFree)
+      socket.removeListener('close', onCloseOrRemove)
+      socket.removeListener('agentRemove', onCloseOrRemove)
+    }
+  })
+}
+
+TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
+  var self = this
+  var placeholder = {}
+  self.sockets.push(placeholder)
+
+  var connectOptions = mergeOptions({}, self.proxyOptions, 
+    { method: 'CONNECT'
+    , path: options.host + ':' + options.port
+    , agent: false
+    }
+  )
+  if (connectOptions.proxyAuth) {
+    connectOptions.headers = connectOptions.headers || {}
+    connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
+        new Buffer(connectOptions.proxyAuth).toString('base64')
+  }
+
+  debug('making CONNECT request')
+  var connectReq = self.request(connectOptions)
+  connectReq.useChunkedEncodingByDefault = false // for v0.6
+  connectReq.once('response', onResponse) // for v0.6
+  connectReq.once('upgrade', onUpgrade)   // for v0.6
+  connectReq.once('connect', onConnect)   // for v0.7 or later
+  connectReq.once('error', onError)
+  connectReq.end()
+
+  function onResponse(res) {
+    // Very hacky. This is necessary to avoid http-parser leaks.
+    res.upgrade = true
+  }
+
+  function onUpgrade(res, socket, head) {
+    // Hacky.
+    process.nextTick(function() {
+      onConnect(res, socket, head)
+    })
+  }
+
+  function onConnect(res, socket, head) {
+    connectReq.removeAllListeners()
+    socket.removeAllListeners()
+
+    if (res.statusCode === 200) {
+      assert.equal(head.length, 0)
+      debug('tunneling connection has established')
+      self.sockets[self.sockets.indexOf(placeholder)] = socket
+      cb(socket)
+    } else {
+      debug('tunneling socket could not be established, statusCode=%d', res.statusCode)
+      var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)
+      error.code = 'ECONNRESET'
+      options.request.emit('error', error)
+      self.removeSocket(placeholder)
+    }
+  }
+
+  function onError(cause) {
+    connectReq.removeAllListeners()
+
+    debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack)
+    var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)
+    error.code = 'ECONNRESET'
+    options.request.emit('error', error)
+    self.removeSocket(placeholder)
+  }
+}
+
+TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
+  var pos = this.sockets.indexOf(socket)
+  if (pos === -1) return
+  
+  this.sockets.splice(pos, 1)
+
+  var pending = this.requests.shift()
+  if (pending) {
+    // If we have pending requests and a socket gets closed a new one
+    // needs to be created to take over in the pool for the one that closed.
+    this.createSocket(pending, function(socket) {
+      pending.request.onSocket(socket)
+    })
+  }
+}
+
+function createSecureSocket(options, cb) {
+  var self = this
+  TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
+    // 0 is dummy port for v0.6
+    var secureSocket = tls.connect(0, mergeOptions({}, self.options, 
+      { servername: options.host
+      , socket: socket
+      }
+    ))
+    cb(secureSocket)
+  })
+}
+
+
+function mergeOptions(target) {
+  for (var i = 1, len = arguments.length; i < len; ++i) {
+    var overrides = arguments[i]
+    if (typeof overrides === 'object') {
+      var keys = Object.keys(overrides)
+      for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
+        var k = keys[j]
+        if (overrides[k] !== undefined) {
+          target[k] = overrides[k]
+        }
+      }
+    }
+  }
+  return target
+}
+
+
+var debug
+if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
+  debug = function() {
+    var args = Array.prototype.slice.call(arguments)
+    if (typeof args[0] === 'string') {
+      args[0] = 'TUNNEL: ' + args[0]
+    } else {
+      args.unshift('TUNNEL:')
+    }
+    console.error.apply(console, args)
+  }
+} else {
+  debug = function() {}
+}
+exports.debug = debug // for test
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/node_modules/tunnel-agent/package.json	(revision 487)
@@ -0,0 +1,28 @@
+{
+  "author": {
+    "name": "Mikeal Rogers",
+    "email": "mikeal.rogers@gmail.com",
+    "url": "http://www.futurealoof.com"
+  },
+  "name": "tunnel-agent",
+  "description": "HTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.",
+  "version": "0.3.0",
+  "repository": {
+    "url": "https://github.com/mikeal/tunnel-agent"
+  },
+  "main": "index.js",
+  "dependencies": {},
+  "devDependencies": {},
+  "optionalDependencies": {},
+  "engines": {
+    "node": "*"
+  },
+  "readme": "tunnel-agent\n============\n\nHTTP proxy tunneling agent. Formerly part of mikeal/request, now a standalone module.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/mikeal/tunnel-agent/issues"
+  },
+  "homepage": "https://github.com/mikeal/tunnel-agent",
+  "_id": "tunnel-agent@0.3.0",
+  "_from": "tunnel-agent@~0.3.0"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/package.json	(revision 487)
@@ -0,0 +1,52 @@
+{
+  "name": "request",
+  "description": "Simplified HTTP request client.",
+  "tags": [
+    "http",
+    "simple",
+    "util",
+    "utility"
+  ],
+  "version": "2.25.0",
+  "author": {
+    "name": "Mikeal Rogers",
+    "email": "mikeal.rogers@gmail.com"
+  },
+  "repository": {
+    "type": "git",
+    "url": "http://github.com/mikeal/request.git"
+  },
+  "bugs": {
+    "url": "http://github.com/mikeal/request/issues"
+  },
+  "engines": [
+    "node >= 0.8.0"
+  ],
+  "main": "index.js",
+  "dependencies": {
+    "qs": "~0.6.0",
+    "json-stringify-safe": "~5.0.0",
+    "forever-agent": "~0.5.0",
+    "tunnel-agent": "~0.3.0",
+    "http-signature": "~0.10.0",
+    "hawk": "~1.0.0",
+    "aws-sign": "~0.3.0",
+    "oauth-sign": "~0.3.0",
+    "cookie-jar": "~0.3.0",
+    "node-uuid": "~1.4.0",
+    "mime": "~1.2.9",
+    "form-data": "~0.1.0"
+  },
+  "scripts": {
+    "test": "node tests/run.js"
+  },
+  "readme": "# Request -- Simplified HTTP request method\n\n## Install\n\n<pre>\n  npm install request\n</pre>\n\nOr from source:\n\n<pre>\n  git clone git://github.com/mikeal/request.git \n  cd request\n  npm link\n</pre>\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```javascript\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n  if (!error && response.statusCode == 200) {\n    console.log(body) // Print the google web page.\n  }\n})\n```\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```javascript\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types, in this case `application/json`, and use the proper content-type in the PUT request if one is not already provided in the headers.\n\n```javascript\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also pipe to itself. When doing so the content-type and content-length will be preserved in the PUT headers.\n\n```javascript\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nNow let's get fancy.\n\n```javascript\nhttp.createServer(function (req, resp) {\n  if (req.url === '/doodle.png') {\n    if (req.method === 'PUT') {\n      req.pipe(request.put('http://mysite.com/doodle.png'))\n    } else if (req.method === 'GET' || req.method === 'HEAD') {\n      request.get('http://mysite.com/doodle.png').pipe(resp)\n    } \n  }\n})\n```\n\nYou can also pipe() from a http.ServerRequest instance and to a http.ServerResponse instance. The HTTP method and headers will be sent as well as the entity-body data. Which means that, if you don't really care about security, you can do:\n\n```javascript\nhttp.createServer(function (req, resp) {\n  if (req.url === '/doodle.png') {\n    var x = request('http://mysite.com/doodle.png')\n    req.pipe(x)\n    x.pipe(resp)\n  }\n})\n```\n\nAnd since pipe() returns the destination stream in node 0.5.x you can do one line proxying :)\n\n```javascript\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```javascript\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n  if (req.url === '/doodle.png') {\n    r.get('http://google.com/doodle.png').pipe(resp)\n  }\n})\n```\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\nUrl encoded forms are simple\n\n```javascript\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n```\n\nFor `multipart/form-data` we use the [form-data](https://github.com/felixge/node-form-data) library by [@felixge](https://github.com/felixge). You don't need to worry about piping the form object or setting the headers, `request` will handle that for you.\n\n```javascript\nvar r = request.post('http://service.com/upload')\nvar form = r.form()\nform.append('my_field', 'my_value')\nform.append('my_buffer', new Buffer([1, 2, 3]))\nform.append('my_file', fs.createReadStream(path.join(__dirname, 'doodle.png'))\nform.append('remote_file', request('http://google.com/doodle.png'))\n```\n\n## HTTP Authentication\n\n```javascript\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n  'auth': {\n    'user': 'username',\n    'pass': 'password',\n    'sendImmediately': false\n  }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional).  The method form takes parameters `auth(username, password, sendImmediately)`.\n\n`sendImmediately` defaults to true, which will cause a basic authentication header to be sent.  If `sendImmediately` is `false`, then `request` will retry with a proper authentication header after receiving a 401 response from the server (which must contain a `WWW-Authenticate` header indicating the required authentication method).\n\nDigest authentication is supported, but it only works with `sendImmediately` set to `false` (otherwise `request` will send basic authentication on the initial request, which will probably cause the request to fail).\n\n## OAuth Signing\n\n```javascript\n// Twitter OAuth\nvar qs = require('querystring')\n  , oauth =\n    { callback: 'http://mysite.com/callback/'\n    , consumer_key: CONSUMER_KEY\n    , consumer_secret: CONSUMER_SECRET\n    }\n  , url = 'https://api.twitter.com/oauth/request_token'\n  ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n  // Ideally, you would take the body in the response\n  // and construct a URL that a user clicks on (like a sign in button).\n  // The verifier is only available in the response after a user has \n  // verified with twitter that they are authorizing your app.\n  var access_token = qs.parse(body)\n    , oauth = \n      { consumer_key: CONSUMER_KEY\n      , consumer_secret: CONSUMER_SECRET\n      , token: access_token.oauth_token\n      , verifier: access_token.oauth_verifier\n      }\n    , url = 'https://api.twitter.com/oauth/access_token'\n    ;\n  request.post({url:url, oauth:oauth}, function (e, r, body) {\n    var perm_token = qs.parse(body)\n      , oauth = \n        { consumer_key: CONSUMER_KEY\n        , consumer_secret: CONSUMER_SECRET\n        , token: perm_token.oauth_token\n        , token_secret: perm_token.oauth_token_secret\n        }\n      , url = 'https://api.twitter.com/1/users/show.json?'\n      , params = \n        { screen_name: perm_token.screen_name\n        , user_id: perm_token.user_id\n        }\n      ;\n    url += qs.stringify(params)\n    request.get({url:url, oauth:oauth, json:true}, function (e, r, user) {\n      console.log(user)\n    })\n  })\n})\n```\n\n\n\n### request(options, callback)\n\nThe first argument can be either a url or an options object. The only required option is uri, all others are optional.\n\n* `uri` || `url` - fully qualified uri or a parsed url object from url.parse()\n* `qs` - object containing querystring values to be appended to the uri\n* `method` - http method, defaults to GET\n* `headers` - http headers, defaults to {}\n* `body` - entity body for PATCH, POST and PUT requests. Must be buffer or string.\n* `form` - when passed an object this will set `body` but to a querystring representation of value and adds `Content-type: application/x-www-form-urlencoded; charset=utf-8` header. When passed no option a FormData instance is returned that will be piped to request.\n* `auth` - A hash containing values `user` || `username`, `password` || `pass`, and `sendImmediately` (optional).  See documentation above.\n* `json` - sets `body` but to JSON representation of value and adds `Content-type: application/json` header.  Additionally, parses the response body as json.\n* `multipart` - (experimental) array of objects which contains their own headers and `body` attribute. Sends `multipart/related` request. See example below.\n* `followRedirect` - follow HTTP 3xx responses as redirects. defaults to true.\n* `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects. defaults to false.\n* `maxRedirects` - the maximum number of redirects to follow, defaults to 10.\n* `encoding` - Encoding to be used on `setEncoding` of response data. If set to `null`, the body is returned as a Buffer.\n* `pool` - A hash object containing the agents for these requests. If omitted this request will use the global pool which is set to node's default maxSockets.\n* `pool.maxSockets` - Integer containing the maximum amount of sockets in the pool.\n* `timeout` - Integer containing the number of milliseconds to wait for a request to respond before aborting the request\t\n* `proxy` - An HTTP proxy to be used. Support proxy Auth with Basic Auth the same way it's supported with the `url` parameter by embedding the auth info in the uri.\n* `oauth` - Options for OAuth HMAC-SHA1 signing, see documentation above.\n* `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n* `strictSSL` - Set to `true` to require that SSL certificates be valid. Note: to use your own certificate authority, you need to specify an agent that was created with that ca as an option.\n* `jar` - Set to `true` if you want cookies to be remembered for future use, or define your custom cookie jar (see examples section)\n* `aws` - object containing aws signing information, should have the properties `key` and `secret` as well as `bucket` unless you're specifying your bucket as part of the path, or you are making a request that doesn't use a bucket (i.e. GET Services)\n* `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n* `localAddress` - Local interface to bind for network connections.\n\n\nThe callback argument gets 3 arguments. The first is an error when applicable (usually from the http.Client option not the http.ClientRequest object). The second is an http.ClientResponse object. The third is the response body String or Buffer.\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n### request.defaults(options)  \n  \nThis method returns a wrapper around the normal request API that defaults to whatever options you pass in to it.\n\n### request.put\n\nSame as request() but defaults to `method: \"PUT\"`.\n\n```javascript\nrequest.put(url)\n```\n\n### request.patch\n\nSame as request() but defaults to `method: \"PATCH\"`.\n\n```javascript\nrequest.patch(url)\n```\n\n### request.post\n\nSame as request() but defaults to `method: \"POST\"`.\n\n```javascript\nrequest.post(url)\n```\n\n### request.head\n\nSame as request() but defaults to `method: \"HEAD\"`.\n\n```javascript\nrequest.head(url)\n```\n\n### request.del\n\nSame as request() but defaults to `method: \"DELETE\"`.\n\n```javascript\nrequest.del(url)\n```\n\n### request.get\n\nAlias to normal request method for uniformity.\n\n```javascript\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```javascript\nrequest.cookie('cookie_string_here')\n```\n### request.jar\n\nFunction that creates a new cookie jar.\n\n```javascript\nrequest.jar()\n```\n\n\n## Examples:\n\n```javascript\n  var request = require('request')\n    , rand = Math.floor(Math.random()*100000000).toString()\n    ;\n  request(\n    { method: 'PUT'\n    , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n    , multipart: \n      [ { 'content-type': 'application/json'\n        ,  body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n        }\n      , { body: 'I am an attachment' }\n      ] \n    }\n  , function (error, response, body) {\n      if(response.statusCode == 201){\n        console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n      } else {\n        console.log('error: '+ response.statusCode)\n        console.log(body)\n      }\n    }\n  )\n```\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies set jar to true (either in defaults or in the options sent).\n\n```javascript\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n  request('http://images.google.com')\n})\n```\n\nIf you to use a custom cookie jar (instead of letting request use its own global cookie jar) you do so by setting the jar default or by specifying it as an option:\n\n```javascript\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n  request('http://images.google.com')\n})\n```\nOR\n\n```javascript\nvar j = request.jar()\nvar cookie = request.cookie('your_cookie_here')\nj.add(cookie)\nrequest({url: 'http://www.google.com', jar: j}, function () {\n  request('http://images.google.com')\n})\n```\n",
+  "readmeFilename": "README.md",
+  "homepage": "https://github.com/mikeal/request",
+  "_id": "request@2.25.0",
+  "dist": {
+    "shasum": "8df99253f984f1649d5b1fa6a18d8a48b51d3b5c"
+  },
+  "_from": "request@2.25.0",
+  "_resolved": "https://registry.npmjs.org/request/-/request-2.25.0.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/run.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/run.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/run.js	(revision 487)
@@ -0,0 +1,40 @@
+var spawn = require('child_process').spawn
+  , exitCode = 0
+  , timeout = 10000
+  , fs = require('fs')
+  ;
+
+fs.readdir(__dirname, function (e, files) {
+  if (e) throw e
+
+  var tests = files.filter(function (f) {return f.slice(0, 'test-'.length) === 'test-'})
+
+  var next = function () {
+    if (tests.length === 0) process.exit(exitCode);
+
+    var file = tests.shift()
+    console.log(file)
+    var proc = spawn('node', [ 'tests/' + file ])
+
+    var killed = false
+    var t = setTimeout(function () {
+      proc.kill()
+      exitCode += 1
+      console.error(file + ' timeout')
+      killed = true
+    }, timeout)
+
+    proc.stdout.pipe(process.stdout)
+    proc.stderr.pipe(process.stderr)
+    proc.on('exit', function (code) {
+      if (code && !killed) console.error(file + ' failed')
+      exitCode += code || 0
+      clearTimeout(t)
+      next()
+    })
+  }
+  next()
+    
+})
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/server.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/server.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/server.js	(revision 487)
@@ -0,0 +1,90 @@
+var fs = require('fs')
+  , http = require('http')
+  , path = require('path')
+  , https = require('https')
+  , events = require('events')
+  , stream = require('stream')
+  , assert = require('assert')
+  ;
+
+exports.createServer =  function (port) {
+  port = port || 6767
+  var s = http.createServer(function (req, resp) {
+    s.emit(req.url, req, resp);
+  })
+  s.port = port
+  s.url = 'http://localhost:'+port
+  return s;
+}
+
+exports.createSSLServer = function(port, opts) {
+  port = port || 16767
+
+  var options = { 'key' : path.join(__dirname, 'ssl', 'test.key')
+                , 'cert': path.join(__dirname, 'ssl', 'test.crt')
+                }
+  if (opts) {
+    for (var i in opts) options[i] = opts[i]
+  }
+
+  for (var i in options) {
+    options[i] = fs.readFileSync(options[i])
+  }
+
+  var s = https.createServer(options, function (req, resp) {
+    s.emit(req.url, req, resp);
+  })
+  s.port = port
+  s.url = 'https://localhost:'+port
+  return s;
+}
+
+exports.createPostStream = function (text) {
+  var postStream = new stream.Stream();
+  postStream.writeable = true;
+  postStream.readable = true;
+  setTimeout(function () {postStream.emit('data', new Buffer(text)); postStream.emit('end')}, 0);
+  return postStream;
+}
+exports.createPostValidator = function (text, reqContentType) {
+  var l = function (req, resp) {
+    var r = '';
+    req.on('data', function (chunk) {r += chunk})
+    req.on('end', function () {
+      if (req.headers['content-type'] && req.headers['content-type'].indexOf('boundary=') >= 0) {
+        var boundary = req.headers['content-type'].split('boundary=')[1];
+        text = text.replace(/__BOUNDARY__/g, boundary);
+      }
+      if (r !== text) console.log(r, text);
+      assert.equal(r, text)
+      if (reqContentType) {
+        assert.ok(req.headers['content-type'])
+        assert.ok(~req.headers['content-type'].indexOf(reqContentType))
+      }
+      resp.writeHead(200, {'content-type':'text/plain'})
+      resp.write('OK')
+      resp.end()
+    })
+  }
+  return l;
+}
+exports.createGetResponse = function (text, contentType) {
+  var l = function (req, resp) {
+    contentType = contentType || 'text/plain'
+    resp.writeHead(200, {'content-type':contentType})
+    resp.write(text)
+    resp.end()
+  }
+  return l;
+}
+exports.createChunkResponse = function (chunks, contentType) {
+  var l = function (req, resp) {
+    contentType = contentType || 'text/plain'
+    resp.writeHead(200, {'content-type':contentType})
+    chunks.forEach(function (chunk) {
+      resp.write(chunk)
+    })
+    resp.end()
+  }
+  return l;
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/squid.conf
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/squid.conf	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/squid.conf	(revision 487)
@@ -0,0 +1,77 @@
+#
+# Recommended minimum configuration:
+#
+acl manager proto cache_object
+acl localhost src 127.0.0.1/32 ::1
+acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
+
+# Example rule allowing access from your local networks.
+# Adapt to list your (internal) IP networks from where browsing
+# should be allowed
+acl localnet src 10.0.0.0/8	# RFC1918 possible internal network
+acl localnet src 172.16.0.0/12	# RFC1918 possible internal network
+acl localnet src 192.168.0.0/16	# RFC1918 possible internal network
+acl localnet src fc00::/7       # RFC 4193 local private network range
+acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines
+
+acl SSL_ports port 443
+acl Safe_ports port 80		# http
+acl Safe_ports port 21		# ftp
+acl Safe_ports port 443		# https
+acl Safe_ports port 70		# gopher
+acl Safe_ports port 210		# wais
+acl Safe_ports port 1025-65535	# unregistered ports
+acl Safe_ports port 280		# http-mgmt
+acl Safe_ports port 488		# gss-http
+acl Safe_ports port 591		# filemaker
+acl Safe_ports port 777		# multiling http
+acl CONNECT method CONNECT
+
+#
+# Recommended minimum Access Permission configuration:
+#
+# Only allow cachemgr access from localhost
+http_access allow manager localhost
+http_access deny manager
+
+# Deny requests to certain unsafe ports
+http_access deny !Safe_ports
+
+# Deny CONNECT to other than secure SSL ports
+#http_access deny CONNECT !SSL_ports
+
+# We strongly recommend the following be uncommented to protect innocent
+# web applications running on the proxy server who think the only
+# one who can access services on "localhost" is a local user
+#http_access deny to_localhost
+
+#
+# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
+#
+
+# Example rule allowing access from your local networks.
+# Adapt localnet in the ACL section to list your (internal) IP networks
+# from where browsing should be allowed
+http_access allow localnet
+http_access allow localhost
+
+# And finally deny all other access to this proxy
+http_access deny all
+
+# Squid normally listens to port 3128
+http_port 3128
+
+# We recommend you to use at least the following line.
+hierarchy_stoplist cgi-bin ?
+
+# Uncomment and adjust the following to add a disk cache directory.
+#cache_dir ufs /usr/local/var/cache 100 16 256
+
+# Leave coredumps in the first cache dir
+coredump_dir /usr/local/var/cache
+
+# Add any of your own refresh_pattern entries above these.
+refresh_pattern ^ftp:		1440	20%	10080
+refresh_pattern ^gopher:	1440	0%	1440
+refresh_pattern -i (/cgi-bin/|\?) 0	0%	0
+refresh_pattern .		0	20%	4320
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.cnf
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.cnf	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.cnf	(revision 487)
@@ -0,0 +1,20 @@
+[ req ]
+default_bits           = 1024
+days                   = 3650
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+output_password        = password
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = Oakland
+O                      = request
+OU                     = request Certificate Authority
+CN                     = requestCA
+emailAddress           = mikeal@mikealrogers.com
+
+[ req_attributes ]
+challengePassword              = password challenge
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.crt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.crt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.crt	(revision 487)
@@ -0,0 +1,17 @@
+-----BEGIN CERTIFICATE-----
+MIICvTCCAiYCCQDn+P/MSbDsWjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1
+ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG
+A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n
+ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGiMQswCQYD
+VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT
+B3JlcXVlc3QxJjAkBgNVBAsTHXJlcXVlc3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5
+MRIwEAYDVQQDEwlyZXF1ZXN0Q0ExJjAkBgkqhkiG9w0BCQEWF21pa2VhbEBtaWtl
+YWxyb2dlcnMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7t9pQUAK4
+5XJYTI6NrF0n3G2HZsfN+rPYSVzzL8SuVyb1tHXos+vbPm3NKI4E8X1yVAXU8CjJ
+5SqXnp4DAypAhaseho81cbhk7LXUhFz78OvAa+OD+xTAEAnNQ8tGUr4VGyplEjfD
+xsBVuqV2j8GPNTftr+drOCFlqfAgMrBn4wIDAQABMA0GCSqGSIb3DQEBBQUAA4GB
+ADVdTlVAL45R+PACNS7Gs4o81CwSclukBu4FJbxrkd4xGQmurgfRrYYKjtqiopQm
+D7ysRamS3HMN9/VKq2T7r3z1PMHPAy7zM4uoXbbaTKwlnX4j/8pGPn8Ca3qHXYlo
+88L/OOPc6Di7i7qckS3HFbXQCTiULtxWmy97oEuTwrAj
+-----END CERTIFICATE-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.csr
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.csr	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.csr	(revision 487)
@@ -0,0 +1,13 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIICBjCCAW8CAQAwgaIxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE
+BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEmMCQGA1UECxMdcmVxdWVzdCBD
+ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxEjAQBgNVBAMTCXJlcXVlc3RDQTEmMCQGCSqG
+SIb3DQEJARYXbWlrZWFsQG1pa2VhbHJvZ2Vycy5jb20wgZ8wDQYJKoZIhvcNAQEB
+BQADgY0AMIGJAoGBALu32lBQArjlclhMjo2sXSfcbYdmx836s9hJXPMvxK5XJvW0
+deiz69s+bc0ojgTxfXJUBdTwKMnlKpeengMDKkCFqx6GjzVxuGTstdSEXPvw68Br
+44P7FMAQCc1Dy0ZSvhUbKmUSN8PGwFW6pXaPwY81N+2v52s4IWWp8CAysGfjAgMB
+AAGgIzAhBgkqhkiG9w0BCQcxFBMScGFzc3dvcmQgY2hhbGxlbmdlMA0GCSqGSIb3
+DQEBBQUAA4GBAGJO7grHeVHXetjHEK8urIxdnvfB2qeZeObz4GPKIkqUurjr0rfj
+bA3EK1kDMR5aeQWR8RunixdM16Q6Ry0lEdLVWkdSwRN9dmirIHT9cypqnD/FYOia
+SdezZ0lUzXgmJIwRYRwB1KSMMocIf52ll/xC2bEGg7/ZAEuAyAgcZV3X
+-----END CERTIFICATE REQUEST-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.key
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.key	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.key	(revision 487)
@@ -0,0 +1,18 @@
+-----BEGIN RSA PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: DES-EDE3-CBC,C8B5887048377F02
+
+nyD5ZH0Wup2uWsDvurq5mKDaDrf8lvNn9w0SH/ZkVnfR1/bkwqrFriqJWvZNUG+q
+nS0iBYczsWLJnbub9a1zLOTENWUKVD5uqbC3aGHhnoUTNSa27DONgP8gHOn6JgR+
+GAKo01HCSTiVT4LjkwN337QKHnMP2fTzg+IoC/CigvMcq09hRLwU1/guq0GJKGwH
+gTxYNuYmQC4Tjh8vdS4liF+Ve/P3qPR2CehZrIOkDT8PHJBGQJRo4xGUIB7Tpk38
+VCk+UZ0JCS2coY8VkY/9tqFJp/ZnnQQVmaNbdRqg7ECKL+bXnNo7yjzmazPZmPe3
+/ShbE0+CTt7LrjCaQAxWbeDzqfo1lQfgN1LulTm8MCXpQaJpv7v1VhIhQ7afjMYb
+4thW/ypHPiYS2YJCAkAVlua9Oxzzh1qJoh8Df19iHtpd79Q77X/qf+1JvITlMu0U
+gi7yEatmQcmYNws1mtTC1q2DXrO90c+NZ0LK/Alse6NRL/xiUdjug2iHeTf/idOR
+Gg/5dSZbnnlj1E5zjSMDkzg6EHAFmHV4jYGSAFLEQgp4V3ZhMVoWZrvvSHgKV/Qh
+FqrAK4INr1G2+/QTd09AIRzfy3/j6yD4A9iNaOsEf9Ua7Qh6RcALRCAZTWR5QtEf
+dX+iSNJ4E85qXs0PqwkMDkoaxIJ+tmIRJY7y8oeylV8cfGAi8Soubt/i3SlR8IHC
+uDMas/2OnwafK3N7ODeE1i7r7wkzQkSHaEz0TrF8XRnP25jAICCSLiMdAAjKfxVb
+EvzsFSuAy3Jt6bU3hSLY9o4YVYKE+68ITMv9yNjvTsEiW+T+IbN34w==
+-----END RSA PRIVATE KEY-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.srl
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.srl	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/ca.srl	(revision 487)
@@ -0,0 +1,1 @@
+ADF62016AA40C9C3
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.cnf
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.cnf	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.cnf	(revision 487)
@@ -0,0 +1,19 @@
+[ req ]
+default_bits           = 1024
+days                   = 3650
+distinguished_name     = req_distinguished_name
+attributes             = req_attributes
+prompt                 = no
+
+[ req_distinguished_name ]
+C                      = US
+ST                     = CA
+L                      = Oakland
+O                      = request
+OU                     = testing
+CN                     = testing.request.mikealrogers.com
+emailAddress           = mikeal@mikealrogers.com
+
+[ req_attributes ]
+challengePassword              = password challenge
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.crt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.crt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.crt	(revision 487)
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIICejCCAeMCCQCt9iAWqkDJwzANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMRAwDgYDVQQKEwdyZXF1
+ZXN0MSYwJAYDVQQLEx1yZXF1ZXN0IENlcnRpZmljYXRlIEF1dGhvcml0eTESMBAG
+A1UEAxMJcmVxdWVzdENBMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlrZWFscm9n
+ZXJzLmNvbTAeFw0xMjAzMDEyMjUwNTZaFw0yMjAyMjcyMjUwNTZaMIGjMQswCQYD
+VQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNVBAcTB09ha2xhbmQxEDAOBgNVBAoT
+B3JlcXVlc3QxEDAOBgNVBAsTB3Rlc3RpbmcxKTAnBgNVBAMTIHRlc3RpbmcucmVx
+dWVzdC5taWtlYWxyb2dlcnMuY29tMSYwJAYJKoZIhvcNAQkBFhdtaWtlYWxAbWlr
+ZWFscm9nZXJzLmNvbTBcMA0GCSqGSIb3DQEBAQUAA0sAMEgCQQDgVl0jMumvOpmM
+20W5v9yhGgZj8hPhEQF/N7yCBVBn/rWGYm70IHC8T/pR5c0LkWc5gdnCJEvKWQjh
+DBKxZD8FAgMBAAEwDQYJKoZIhvcNAQEFBQADgYEABShRkNgFbgs4vUWW9R9deNJj
+7HJoiTmvkmoOC7QzcYkjdgHbOxsSq3rBnwxsVjY9PAtPwBn0GRspOeG7KzKRgySB
+kb22LyrCFKbEOfKO/+CJc80ioK9zEPVjGsFMyAB+ftYRqM+s/4cQlTg/m89l01wC
+yapjN3RxZbInGhWR+jA=
+-----END CERTIFICATE-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.csr
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.csr	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.csr	(revision 487)
@@ -0,0 +1,11 @@
+-----BEGIN CERTIFICATE REQUEST-----
+MIIBgjCCASwCAQAwgaMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJDQTEQMA4GA1UE
+BxMHT2FrbGFuZDEQMA4GA1UEChMHcmVxdWVzdDEQMA4GA1UECxMHdGVzdGluZzEp
+MCcGA1UEAxMgdGVzdGluZy5yZXF1ZXN0Lm1pa2VhbHJvZ2Vycy5jb20xJjAkBgkq
+hkiG9w0BCQEWF21pa2VhbEBtaWtlYWxyb2dlcnMuY29tMFwwDQYJKoZIhvcNAQEB
+BQADSwAwSAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg
+cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAaAjMCEGCSqGSIb3DQEJBzEU
+ExJwYXNzd29yZCBjaGFsbGVuZ2UwDQYJKoZIhvcNAQEFBQADQQBD3E5WekQzCEJw
+7yOcqvtPYIxGaX8gRKkYfLPoj3pm3GF5SGqtJKhylKfi89szHXgktnQgzff9FN+A
+HidVJ/3u
+-----END CERTIFICATE REQUEST-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.js	(revision 487)
@@ -0,0 +1,28 @@
+var fs = require("fs")
+var https = require("https")
+var options = { key: fs.readFileSync("./server.key")
+              , cert: fs.readFileSync("./server.crt") }
+
+var server = https.createServer(options, function (req, res) {
+  res.writeHead(200)
+  res.end()
+  server.close()
+})
+server.listen(1337)
+
+var ca = fs.readFileSync("./ca.crt")
+var agent = new https.Agent({ host: "localhost", port: 1337, ca: ca })
+
+https.request({ host: "localhost"
+              , method: "HEAD"
+              , port: 1337
+              , headers: { host: "testing.request.mikealrogers.com" }
+              , agent: agent
+              , ca: [ ca ]
+              , path: "/" }, function (res) {
+  if (res.client.authorized) {
+    console.log("node test: OK")
+  } else {
+    throw new Error(res.client.authorizationError)
+  }
+}).end()
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.key
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.key	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/ca/server.key	(revision 487)
@@ -0,0 +1,9 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIBOwIBAAJBAOBWXSMy6a86mYzbRbm/3KEaBmPyE+ERAX83vIIFUGf+tYZibvQg
+cLxP+lHlzQuRZzmB2cIkS8pZCOEMErFkPwUCAwEAAQJAK+r8ZM2sze8s7FRo/ApB
+iRBtO9fCaIdJwbwJnXKo4RKwZDt1l2mm+fzZ+/QaQNjY1oTROkIIXmnwRvZWfYlW
+gQIhAPKYsG+YSBN9o8Sdp1DMyZ/rUifKX3OE6q9tINkgajDVAiEA7Ltqh01+cnt0
+JEnud/8HHcuehUBLMofeg0G+gCnSbXECIQCqDvkXsWNNLnS/3lgsnvH0Baz4sbeJ
+rjIpuVEeg8eM5QIgbu0+9JmOV6ybdmmiMV4yAncoF35R/iKGVHDZCAsQzDECIQDZ
+0jGz22tlo5YMcYSqrdD3U4sds1pwiAaWFRbCunoUJw==
+-----END RSA PRIVATE KEY-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/npm-ca.crt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/npm-ca.crt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/npm-ca.crt	(revision 487)
@@ -0,0 +1,16 @@
+-----BEGIN CERTIFICATE-----
+MIIChzCCAfACCQDauvz/KHp8ejANBgkqhkiG9w0BAQUFADCBhzELMAkGA1UEBhMC
+VVMxCzAJBgNVBAgTAkNBMRAwDgYDVQQHEwdPYWtsYW5kMQwwCgYDVQQKEwNucG0x
+IjAgBgNVBAsTGW5wbSBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxDjAMBgNVBAMTBW5w
+bUNBMRcwFQYJKoZIhvcNAQkBFghpQGl6cy5tZTAeFw0xMTA5MDUwMTQ3MTdaFw0y
+MTA5MDIwMTQ3MTdaMIGHMQswCQYDVQQGEwJVUzELMAkGA1UECBMCQ0ExEDAOBgNV
+BAcTB09ha2xhbmQxDDAKBgNVBAoTA25wbTEiMCAGA1UECxMZbnBtIENlcnRpZmlj
+YXRlIEF1dGhvcml0eTEOMAwGA1UEAxMFbnBtQ0ExFzAVBgkqhkiG9w0BCQEWCGlA
+aXpzLm1lMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLI4tIqPpRW+ACw9GE
+OgBlJZwK5f8nnKCLK629Pv5yJpQKs3DENExAyOgDcyaF0HD0zk8zTp+ZsLaNdKOz
+Gn2U181KGprGKAXP6DU6ByOJDWmTlY6+Ad1laYT0m64fERSpHw/hjD3D+iX4aMOl
+y0HdbT5m1ZGh6SJz3ZqxavhHLQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAC4ySDbC
+l7W1WpLmtLGEQ/yuMLUf6Jy/vr+CRp4h+UzL+IQpCv8FfxsYE7dhf/bmWTEupBkv
+yNL18lipt2jSvR3v6oAHAReotvdjqhxddpe5Holns6EQd1/xEZ7sB1YhQKJtvUrl
+ZNufy1Jf1r0ldEGeA+0ISck7s+xSh9rQD2Op
+-----END CERTIFICATE-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/test.crt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/test.crt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/test.crt	(revision 487)
@@ -0,0 +1,15 @@
+-----BEGIN CERTIFICATE-----
+MIICQzCCAawCCQCO/XWtRFck1jANBgkqhkiG9w0BAQUFADBmMQswCQYDVQQGEwJU
+SDEQMA4GA1UECBMHQmFuZ2tvazEOMAwGA1UEBxMFU2lsb20xGzAZBgNVBAoTElRo
+ZSBSZXF1ZXN0IE1vZHVsZTEYMBYGA1UEAxMPcmVxdWVzdC5leGFtcGxlMB4XDTEx
+MTIwMzAyMjkyM1oXDTIxMTEzMDAyMjkyM1owZjELMAkGA1UEBhMCVEgxEDAOBgNV
+BAgTB0Jhbmdrb2sxDjAMBgNVBAcTBVNpbG9tMRswGQYDVQQKExJUaGUgUmVxdWVz
+dCBNb2R1bGUxGDAWBgNVBAMTD3JlcXVlc3QuZXhhbXBsZTCBnzANBgkqhkiG9w0B
+AQEFAAOBjQAwgYkCgYEAwmctddZqlA48+NXs0yOy92DijcQV1jf87zMiYAIlNUto
+wghVbTWgJU5r0pdKrD16AptnWJTzKanhItEX8XCCPgsNkq1afgTtJP7rNkwu3xcj
+eIMkhJg/ay4ZnkbnhYdsii5VTU5prix6AqWRAhbkBgoA+iVyHyof8wvZyKBoFTMC
+AwEAATANBgkqhkiG9w0BAQUFAAOBgQB6BybMJbpeiABgihDfEVBcAjDoQ8gUMgwV
+l4NulugfKTDmArqnR9aPd4ET5jX5dkMP4bwCHYsvrcYDeWEQy7x5WWuylOdKhua4
+L4cEi2uDCjqEErIG3cc1MCOk6Cl6Ld6tkIzQSf953qfdEACRytOeUqLNQcrXrqeE
+c7U8F6MWLQ==
+-----END CERTIFICATE-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/test.key
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/test.key	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/ssl/test.key	(revision 487)
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXgIBAAKBgQDCZy111mqUDjz41ezTI7L3YOKNxBXWN/zvMyJgAiU1S2jCCFVt
+NaAlTmvSl0qsPXoCm2dYlPMpqeEi0RfxcII+Cw2SrVp+BO0k/us2TC7fFyN4gySE
+mD9rLhmeRueFh2yKLlVNTmmuLHoCpZECFuQGCgD6JXIfKh/zC9nIoGgVMwIDAQAB
+AoGBALXFwfUf8vHTSmGlrdZS2AGFPvEtuvldyoxi9K5u8xmdFCvxnOcLsF2RsTHt
+Mu5QYWhUpNJoG+IGLTPf7RJdj/kNtEs7xXqWy4jR36kt5z5MJzqiK+QIgiO9UFWZ
+fjUb6oeDnTIJA9YFBdYi97MDuL89iU/UK3LkJN3hd4rciSbpAkEA+MCkowF5kSFb
+rkOTBYBXZfiAG78itDXN6DXmqb9XYY+YBh3BiQM28oxCeQYyFy6pk/nstnd4TXk6
+V/ryA2g5NwJBAMgRKTY9KvxJWbESeMEFe2iBIV0c26/72Amgi7ZKUCLukLfD4tLF
++WSZdmTbbqI1079YtwaiOVfiLm45Q/3B0eUCQAaQ/0eWSGE+Yi8tdXoVszjr4GXb
+G81qBi91DMu6U1It+jNfIba+MPsiHLcZJMVb4/oWBNukN7bD1nhwFWdlnu0CQQCf
+Is9WHkdvz2RxbZDxb8verz/7kXXJQJhx5+rZf7jIYFxqX3yvTNv3wf2jcctJaWlZ
+fVZwB193YSivcgt778xlAkEAprYUz3jczjF5r2hrgbizPzPDR94tM5BTO3ki2v3w
+kbf+j2g7FNAx6kZiVN8XwfLc8xEeUGiPKwtq3ddPDFh17w==
+-----END RSA PRIVATE KEY-----
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-agentOptions.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-agentOptions.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-agentOptions.js	(revision 487)
@@ -0,0 +1,23 @@
+var request = require('../index')
+  , http = require('http')
+  , server = require('./server')
+  , assert = require('assert')
+  ;
+
+var s = http.createServer(function (req, resp) {
+  resp.statusCode = 200
+  resp.end('')
+}).listen(6767, function () {
+  // requests without agentOptions should use global agent
+  var r = request('http://localhost:6767', function (e, resp, body) {
+    assert.deepEqual(r.agent, http.globalAgent);
+    assert.equal(Object.keys(r.pool).length, 0);
+
+    // requests with agentOptions should apply agentOptions to new agent in pool
+    var r2 = request('http://localhost:6767', { agentOptions: { foo: 'bar' } }, function (e, resp, body) {
+      assert.deepEqual(r2.agent.options, { foo: 'bar' });
+      assert.equal(Object.keys(r2.pool).length, 1);
+	    s.close()
+ 	 });
+  })
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-basic-auth.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-basic-auth.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-basic-auth.js	(revision 487)
@@ -0,0 +1,143 @@
+var assert = require('assert')
+  , http = require('http')
+  , request = require('../index')
+  ;
+
+var numBasicRequests = 0;
+
+var basicServer = http.createServer(function (req, res) {
+  console.error('Basic auth server: ', req.method, req.url);
+  numBasicRequests++;
+
+  var ok;
+
+  if (req.headers.authorization) {
+    if (req.headers.authorization == 'Basic ' + new Buffer('test:testing2').toString('base64')) {
+      ok = true;
+    } else if ( req.headers.authorization == 'Basic ' + new Buffer(':apassword').toString('base64')) {
+      ok = true;
+    } else {
+      // Bad auth header, don't send back WWW-Authenticate header
+      ok = false;
+    }
+  } else {
+    // No auth header, send back WWW-Authenticate header
+    ok = false;
+    res.setHeader('www-authenticate', 'Basic realm="Private"');
+  }
+
+  if (req.url == '/post/') {
+    var expectedContent = 'data_key=data_value';
+    req.on('data', function(data) {
+      assert.equal(data, expectedContent);
+      console.log('received request data: ' + data);
+    });
+    assert.equal(req.method, 'POST');
+    assert.equal(req.headers['content-length'], '' + expectedContent.length);
+    assert.equal(req.headers['content-type'], 'application/x-www-form-urlencoded; charset=utf-8');
+  }
+
+  if (ok) {
+    console.log('request ok');
+    res.end('ok');
+  } else {
+    console.log('status=401');
+    res.statusCode = 401;
+    res.end('401');
+  }
+});
+
+basicServer.listen(6767);
+
+var tests = [
+  function(next) {
+    request({
+      'method': 'GET',
+      'uri': 'http://localhost:6767/test/',
+      'auth': {
+        'user': 'test',
+        'pass': 'testing2',
+        'sendImmediately': false
+      }
+    }, function(error, res, body) {
+      assert.equal(res.statusCode, 200);
+      assert.equal(numBasicRequests, 2);
+      next();
+    });
+  },
+
+  function(next) {
+    // If we don't set sendImmediately = false, request will send basic auth
+    request({
+      'method': 'GET',
+      'uri': 'http://localhost:6767/test2/',
+      'auth': {
+        'user': 'test',
+        'pass': 'testing2'
+      }
+    }, function(error, res, body) {
+      assert.equal(res.statusCode, 200);
+      assert.equal(numBasicRequests, 3);
+      next();
+    });
+  },
+
+  function(next) {
+    request({
+      'method': 'GET',
+      'uri': 'http://test:testing2@localhost:6767/test2/'
+    }, function(error, res, body) {
+      assert.equal(res.statusCode, 200);
+      assert.equal(numBasicRequests, 4);
+      next();
+    });
+  },
+
+  function(next) {
+    request({
+      'method': 'POST',
+      'form': { 'data_key': 'data_value' },
+      'uri': 'http://localhost:6767/post/',
+      'auth': {
+        'user': 'test',
+        'pass': 'testing2',
+        'sendImmediately': false
+      }
+    }, function(error, res, body) {
+      assert.equal(res.statusCode, 200);
+      assert.equal(numBasicRequests, 6);
+      next();
+    });
+  },
+
+  function(next) {
+    assert.doesNotThrow( function() {
+      request({
+        'method': 'GET',
+        'uri': 'http://localhost:6767/allow_empty_user/',
+        'auth': {
+          'user': '',
+          'pass': 'apassword',
+          'sendImmediately': false
+        }
+      }, function(error, res, body ) {
+        assert.equal(res.statusCode, 200);
+        assert.equal(numBasicRequests, 8);
+        next();
+      });
+    })
+  }
+];
+
+function runTest(i) {
+  if (i < tests.length) {
+    tests[i](function() {
+      runTest(i + 1);
+    });
+  } else {
+    console.log('All tests passed');
+    basicServer.close();
+  }
+}
+
+runTest(0);
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-body.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-body.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-body.js	(revision 487)
@@ -0,0 +1,122 @@
+var server = require('./server')
+  , events = require('events')
+  , stream = require('stream')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var s = server.createServer();
+
+var tests =
+  { testGet :
+    { resp : server.createGetResponse("TESTING!")
+    , expectBody: "TESTING!"
+    }
+  , testGetChunkBreak :
+    { resp : server.createChunkResponse(
+      [ new Buffer([239])
+      , new Buffer([163])
+      , new Buffer([191])
+      , new Buffer([206])
+      , new Buffer([169])
+      , new Buffer([226])
+      , new Buffer([152])
+      , new Buffer([131])
+      ])
+    , expectBody: "ï£¿Î©â"
+    }
+  , testGetBuffer :
+    { resp : server.createGetResponse(new Buffer("TESTING!"))
+    , encoding: null
+    , expectBody: new Buffer("TESTING!")
+    }
+  , testGetEncoding :
+    { resp : server.createGetResponse(new Buffer('efa3bfcea9e29883', 'hex'))
+    , encoding: 'hex'
+    , expectBody: "efa3bfcea9e29883"
+    }
+  , testGetUTF8:
+     { resp: server.createGetResponse(new Buffer([0xEF, 0xBB, 0xBF, 226, 152, 131]))
+     , encoding: "utf8"
+     , expectBody: "â"
+     }
+  , testGetJSON :
+     { resp : server.createGetResponse('{"test":true}', 'application/json')
+     , json : true
+     , expectBody: {"test":true}
+     }
+  , testPutString :
+    { resp : server.createPostValidator("PUTTINGDATA")
+    , method : "PUT"
+    , body : "PUTTINGDATA"
+    }
+  , testPutBuffer :
+    { resp : server.createPostValidator("PUTTINGDATA")
+    , method : "PUT"
+    , body : new Buffer("PUTTINGDATA")
+    }
+  , testPutJSON :
+    { resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
+    , method: "PUT"
+    , json: {foo: 'bar'}
+    }
+  , testPutMultipart :
+    { resp: server.createPostValidator(
+        '--__BOUNDARY__\r\n' +
+        'content-type: text/html\r\n' +
+        '\r\n' +
+        '<html><body>Oh hi.</body></html>' +
+        '\r\n--__BOUNDARY__\r\n\r\n' +
+        'Oh hi.' +
+        '\r\n--__BOUNDARY__--'
+        )
+    , method: "PUT"
+    , multipart:
+      [ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
+      , {'body': 'Oh hi.'}
+      ]
+    }
+  , testPutMultipartPreambleCRLF :
+    { resp: server.createPostValidator(
+        '\r\n--__BOUNDARY__\r\n' +
+        'content-type: text/html\r\n' +
+        '\r\n' +
+        '<html><body>Oh hi.</body></html>' +
+        '\r\n--__BOUNDARY__\r\n\r\n' +
+        'Oh hi.' +
+        '\r\n--__BOUNDARY__--'
+        )
+    , method: "PUT"
+    , preambleCRLF: true
+    , multipart:
+      [ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
+      , {'body': 'Oh hi.'}
+      ]
+    }
+  }
+
+s.listen(s.port, function () {
+
+  var counter = 0
+
+  for (i in tests) {
+    (function () {
+      var test = tests[i]
+      s.on('/'+i, test.resp)
+      test.uri = s.url + '/' + i
+      request(test, function (err, resp, body) {
+        if (err) throw err
+        if (test.expectBody) {
+          assert.deepEqual(test.expectBody, body)
+        }
+        counter = counter - 1;
+        if (counter === 0) {
+          console.log(Object.keys(tests).length+" tests passed.")
+          s.close()
+        }
+      })
+      counter++
+    })()
+  }
+})
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-defaults.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-defaults.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-defaults.js	(revision 487)
@@ -0,0 +1,129 @@
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var s = server.createServer();
+
+s.listen(s.port, function () {
+  var counter = 0;
+  s.on('/get', function (req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.method, 'GET')
+    resp.writeHead(200, {'Content-Type': 'text/plain'});
+    resp.end('TESTING!');
+  });
+
+  // test get(string, function)
+  request.defaults({headers:{foo:"bar"}})(s.url + '/get', function (e, r, b){
+    if (e) throw e;
+    assert.deepEqual("TESTING!", b);
+    counter += 1;
+  });
+
+  s.on('/post', function (req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.headers['content-type'], null);
+    assert.equal(req.method, 'POST')
+    resp.writeHead(200, {'Content-Type': 'application/json'});
+    resp.end(JSON.stringify({foo:'bar'}));
+  });
+
+  // test post(string, object, function)
+  request.defaults({headers:{foo:"bar"}}).post(s.url + '/post', {json: true}, function (e, r, b){
+    if (e) throw e;
+    assert.deepEqual('bar', b.foo);
+    counter += 1;
+  });
+
+  s.on('/patch', function (req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.headers['content-type'], null);
+    assert.equal(req.method, 'PATCH')
+    resp.writeHead(200, {'Content-Type': 'application/json'});
+    resp.end(JSON.stringify({foo:'bar'}));
+  });
+
+  // test post(string, object, function)
+  request.defaults({headers:{foo:"bar"}}).patch(s.url + '/patch', {json: true}, function (e, r, b){
+    if (e) throw e;
+    assert.deepEqual('bar', b.foo);
+    counter += 1;
+  });
+
+  s.on('/post-body', function (req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.headers['content-type'], 'application/json');
+    assert.equal(req.method, 'POST')
+    resp.writeHead(200, {'Content-Type': 'application/json'});
+    resp.end(JSON.stringify({foo:'bar'}));
+  });
+
+  // test post(string, object, function) with body
+  request.defaults({headers:{foo:"bar"}}).post(s.url + '/post-body', {json: true, body:{bar:"baz"}}, function (e, r, b){
+    if (e) throw e;
+    assert.deepEqual('bar', b.foo);
+    counter += 1;
+  });
+
+  s.on('/del', function (req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.method, 'DELETE')
+    resp.writeHead(200, {'Content-Type': 'application/json'});
+    resp.end(JSON.stringify({foo:'bar'}));
+  });
+
+  // test .del(string, function)
+  request.defaults({headers:{foo:"bar"}, json:true}).del(s.url + '/del', function (e, r, b){
+    if (e) throw e;
+    assert.deepEqual('bar', b.foo);
+    counter += 1;
+  });
+
+  s.on('/head', function (req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.method, 'HEAD')
+    resp.writeHead(200, {'Content-Type': 'text/plain'});
+    resp.end();
+  });
+
+  // test head.(object, function)
+  request.defaults({headers:{foo:"bar"}}).head({uri: s.url + '/head'}, function (e, r, b){
+    if (e) throw e;
+    counter += 1;
+  });
+
+  s.on('/get_custom', function(req, resp) {
+    assert.equal(req.headers.foo, 'bar');
+    assert.equal(req.headers.x, 'y');
+    resp.writeHead(200, {'Content-Type': 'text/plain'});
+    resp.end();
+  });
+
+  // test custom request handler function
+  var defaultRequest = request.defaults({
+    headers:{foo:"bar"}
+    , body: 'TESTING!'
+  }, function(uri, options, callback) {
+    var params = request.initParams(uri, options, callback);
+    options = params.options;
+    options.headers.x = 'y';
+
+    return request(params.uri, params.options, params.callback);
+  });
+
+  var msg = 'defaults test failed. head request should throw earlier';
+  assert.throws(function() {
+    defaultRequest.head(s.url + '/get_custom', function(e, r, b) {
+      throw new Error(msg);
+    });
+    counter+=1;
+  }, msg);
+
+  defaultRequest.get(s.url + '/get_custom', function(e, r, b) {
+    if(e) throw e;
+    counter += 1;
+    console.log(counter.toString() + " tests passed.");
+    s.close();
+  });
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-digest-auth.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-digest-auth.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-digest-auth.js	(revision 487)
@@ -0,0 +1,69 @@
+var assert = require('assert')
+  , http = require('http')
+  , request = require('../index')
+  ;
+
+// Test digest auth
+// Using header values captured from interaction with Apache
+
+var numDigestRequests = 0;
+
+var digestServer = http.createServer(function (req, res) {
+  console.error('Digest auth server: ', req.method, req.url);
+  numDigestRequests++;
+
+  var ok;
+
+  if (req.headers.authorization) {
+    if (req.headers.authorization == 'Digest username="test", realm="Private", nonce="WpcHS2/TBAA=dffcc0dbd5f96d49a5477166649b7c0ae3866a93", uri="/test/", qop="auth", response="54753ce37c10cb20b09b769f0bed730e", nc="1", cnonce=""') {
+      ok = true;
+    } else {
+      // Bad auth header, don't send back WWW-Authenticate header
+      ok = false;
+    }
+  } else {
+    // No auth header, send back WWW-Authenticate header
+    ok = false;
+    res.setHeader('www-authenticate', 'Digest realm="Private", nonce="WpcHS2/TBAA=dffcc0dbd5f96d49a5477166649b7c0ae3866a93", algorithm=MD5, qop="auth"');
+  }
+
+  if (ok) {
+    console.log('request ok');
+    res.end('ok');
+  } else {
+    console.log('status=401');
+    res.statusCode = 401;
+    res.end('401');
+  }
+});
+
+digestServer.listen(6767);
+
+request({
+  'method': 'GET',
+  'uri': 'http://localhost:6767/test/',
+  'auth': {
+    'user': 'test',
+    'pass': 'testing',
+    'sendImmediately': false
+  }
+}, function(error, response, body) {
+  assert.equal(response.statusCode, 200);
+  assert.equal(numDigestRequests, 2);
+
+  // If we don't set sendImmediately = false, request will send basic auth
+  request({
+    'method': 'GET',
+    'uri': 'http://localhost:6767/test/',
+    'auth': {
+      'user': 'test',
+      'pass': 'testing'
+    }
+  }, function(error, response, body) {
+    assert.equal(response.statusCode, 401);
+    assert.equal(numDigestRequests, 3);
+
+    console.log('All tests passed');
+    digestServer.close();
+  });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-emptyBody.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-emptyBody.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-emptyBody.js	(revision 487)
@@ -0,0 +1,20 @@
+var request = require('../index')
+  , http = require('http')
+  , assert = require('assert')
+  ;
+
+var s = http.createServer(function (req, resp) {
+  resp.statusCode = 200
+  resp.end('')
+}).listen(8080, function () {
+  var r = request('http://localhost:8080', function (e, resp, body) {
+    assert.equal(resp.statusCode, 200)
+    assert.equal(body, "")
+
+    var r2 = request({ url: 'http://localhost:8080', json: {} }, function (e, resp, body) {
+	    assert.equal(resp.statusCode, 200)
+	    assert.equal(body, undefined)
+	    s.close()
+ 	 });
+  })
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-errors.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-errors.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-errors.js	(revision 487)
@@ -0,0 +1,37 @@
+var server = require('./server')
+  , events = require('events')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var local = 'http://localhost:8888/asdf'
+
+try {
+  request({uri:local, body:{}})
+  assert.fail("Should have throw") 
+} catch(e) {
+  assert.equal(e.message, 'Argument error, options.body.')
+}
+
+try {
+  request({uri:local, multipart: 'foo'})
+  assert.fail("Should have throw")
+} catch(e) {
+  assert.equal(e.message, 'Argument error, options.multipart.')
+}
+
+try {
+  request({uri:local, multipart: [{}]})
+  assert.fail("Should have throw")
+} catch(e) {
+  assert.equal(e.message, 'Body attribute missing in multipart.')
+}
+
+try {
+  request(local, {multipart: [{}]})
+  assert.fail("Should have throw")
+} catch(e) {
+  assert.equal(e.message, 'Body attribute missing in multipart.')
+}
+
+console.log("All tests passed.")
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-follow-all-303.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-follow-all-303.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-follow-all-303.js	(revision 487)
@@ -0,0 +1,30 @@
+var request = require('../index');
+var http = require('http');
+var requests = 0;
+var assert = require('assert');
+
+var server = http.createServer(function (req, res) {
+  console.error(req.method, req.url);
+  requests ++;
+
+  if (req.method === 'POST') {
+    console.error('send 303');
+    res.setHeader('location', req.url);
+    res.statusCode = 303;
+    res.end('try again, i guess\n');
+  } else {
+    console.error('send 200')
+    res.end('ok: ' + requests);
+  }
+});
+server.listen(6767);
+
+request.post({ url: 'http://localhost:6767/foo',
+               followAllRedirects: true,
+               form: { foo: 'bar' } }, function (er, req, body) {
+  if (er) throw er;
+  assert.equal(body, 'ok: 2');
+  assert.equal(requests, 2);
+  console.error('ok - ' + process.version);
+  server.close();
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-follow-all.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-follow-all.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-follow-all.js	(revision 487)
@@ -0,0 +1,36 @@
+var request = require('../index');
+var http = require('http');
+var requests = 0;
+var assert = require('assert');
+
+var server = http.createServer(function (req, res) {
+  requests ++;
+
+  // redirect everything 3 times, no matter what.
+  var c = req.headers.cookie;
+
+  if (!c) c = 0;
+  else c = +c.split('=')[1] || 0;
+
+  if (c > 3) {
+    res.end('ok: '+requests);
+    return;
+  }
+
+  res.setHeader('set-cookie', 'c=' + (c + 1));
+  res.setHeader('location', req.url);
+  res.statusCode = 302;
+  res.end('try again, i guess\n');
+});
+server.listen(6767);
+
+request.post({ url: 'http://localhost:6767/foo',
+               followAllRedirects: true,
+               jar: true,
+               form: { foo: 'bar' } }, function (er, req, body) {
+  if (er) throw er;
+  assert.equal(body, 'ok: 5');
+  assert.equal(requests, 5);
+  console.error('ok - ' + process.version);
+  server.close();
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-form.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-form.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-form.js	(revision 487)
@@ -0,0 +1,79 @@
+var assert = require('assert')
+var http = require('http');
+var path = require('path');
+var mime = require('mime');
+var request = require('../index');
+var fs = require('fs');
+
+var remoteFile = 'http://nodejs.org/images/logo.png';
+
+var FIELDS = [
+  {name: 'my_field', value: 'my_value'},
+  {name: 'my_buffer', value: new Buffer([1, 2, 3])},
+  {name: 'my_file', value: fs.createReadStream(__dirname + '/unicycle.jpg')},
+  {name: 'remote_file', value: request(remoteFile) }
+];
+
+var server = http.createServer(function(req, res) {
+
+  // temp workaround
+  var data = '';
+  req.setEncoding('utf8');
+
+  req.on('data', function(d) {
+    data += d;
+  });
+
+  req.on('end', function() {
+    // check for the fields' traces
+
+    // 1st field : my_field
+    var field = FIELDS.shift();
+    assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 );
+    assert.ok( data.indexOf(field.value) != -1 );
+
+    // 2nd field : my_buffer
+    var field = FIELDS.shift();
+    assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 );
+    assert.ok( data.indexOf(field.value) != -1 );
+
+    // 3rd field : my_file
+    var field = FIELDS.shift();
+    assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 );
+    assert.ok( data.indexOf('; filename="'+path.basename(field.value.path)+'"') != -1 );
+    // check for unicycle.jpg traces
+    assert.ok( data.indexOf('2005:06:21 01:44:12') != -1 );
+    assert.ok( data.indexOf('Content-Type: '+mime.lookup(field.value.path) ) != -1 );
+
+    // 4th field : remote_file
+    var field = FIELDS.shift();
+    assert.ok( data.indexOf('form-data; name="'+field.name+'"') != -1 );
+    assert.ok( data.indexOf('; filename="'+path.basename(field.value.path)+'"') != -1 );
+    // check for http://nodejs.org/images/logo.png traces
+    assert.ok( data.indexOf('ImageReady') != -1 );
+    assert.ok( data.indexOf('Content-Type: '+mime.lookup(remoteFile) ) != -1 );
+
+    res.writeHead(200);
+    res.end('done');
+
+  });
+
+
+});
+
+server.listen(8080, function() {
+
+  var req = request.post('http://localhost:8080/upload', function () {
+    server.close();
+  })
+  var form = req.form()
+  
+  FIELDS.forEach(function(field) {
+    form.append(field.name, field.value);
+  });
+
+});
+
+process.on('exit', function() {
+  assert.strictEqual(FIELDS.length, 0);
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-hawk.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-hawk.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-hawk.js	(revision 487)
@@ -0,0 +1,33 @@
+var createServer = require('http').createServer
+  , request = require('../index')
+  , hawk = require('hawk')
+  , assert = require('assert')
+  ;
+
+var server = createServer(function (req, resp) {
+  
+  var getCred = function (id, callback) {
+    assert.equal(id, 'dh37fgj492je')
+    var credentials = 
+      { key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn'
+      , algorithm: 'sha256'
+      , user: 'Steve'
+      }
+    return callback(null, credentials)
+  }
+
+  hawk.server.authenticate(req, getCred, {}, function (err, credentials, attributes) {
+    resp.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' })
+    resp.end(!err ? 'Hello ' + credentials.user : 'Shoosh!')
+  })
+  
+})
+
+server.listen(8080, function () {
+  var creds = {key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn', algorithm: 'sha256', id:'dh37fgj492je'}
+  request('http://localhost:8080', {hawk:{credentials:creds}}, function (e, r, b) {
+    assert.equal(200, r.statusCode)
+    assert.equal(b, 'Hello Steve')
+    server.close()
+  })
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-headers.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-headers.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-headers.js	(revision 487)
@@ -0,0 +1,52 @@
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+  , Cookie = require('cookie-jar')
+  , Jar = Cookie.Jar
+  , s = server.createServer()
+
+s.listen(s.port, function () {
+  var serverUri = 'http://localhost:' + s.port
+    , numTests = 0
+    , numOutstandingTests = 0
+
+  function createTest(requestObj, serverAssertFn) {
+    var testNumber = numTests;
+    numTests += 1;
+    numOutstandingTests += 1;
+    s.on('/' + testNumber, function (req, res) {
+      serverAssertFn(req, res);
+      res.writeHead(200);
+      res.end();
+    });
+    requestObj.url = serverUri + '/' + testNumber
+    request(requestObj, function (err, res, body) {
+      assert.ok(!err)
+      assert.equal(res.statusCode, 200)
+      numOutstandingTests -= 1
+      if (numOutstandingTests === 0) {
+        console.log(numTests + ' tests passed.')
+        s.close()
+      }
+    })
+  }
+
+  // Issue #125: headers.cookie shouldn't be replaced when a cookie jar isn't specified
+  createTest({headers: {cookie: 'foo=bar'}}, function (req, res) {
+    assert.ok(req.headers.cookie)
+    assert.equal(req.headers.cookie, 'foo=bar')
+  })
+
+  // Issue #125: headers.cookie + cookie jar
+  var jar = new Jar()
+  jar.add(new Cookie('quux=baz'));
+  createTest({jar: jar, headers: {cookie: 'foo=bar'}}, function (req, res) {
+    assert.ok(req.headers.cookie)
+    assert.equal(req.headers.cookie, 'foo=bar; quux=baz')
+  })
+
+  // There should be no cookie header when neither headers.cookie nor a cookie jar is specified
+  createTest({}, function (req, res) {
+    assert.ok(!req.headers.cookie)
+  })
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-http-signature.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-http-signature.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-http-signature.js	(revision 487)
@@ -0,0 +1,106 @@
+var createServer = require('http').createServer
+  , request = require('../index')
+  , httpSignature = require('http-signature')
+  , assert = require('assert')
+  ;
+
+var privateKeyPEMs = {}
+
+privateKeyPEMs['key-1'] =
+  '-----BEGIN RSA PRIVATE KEY-----\n' +
+  'MIIEpAIBAAKCAQEAzWSJl+Z9Bqv00FVL5N3+JCUoqmQPjIlya1BbeqQroNQ5yG1i\n' +
+  'VbYTTnMRa1zQtR6r2fNvWeg94DvxivxIG9diDMnrzijAnYlTLOl84CK2vOxkj5b6\n' +
+  '8zrLH9b/Gd6NOHsywo8IjvXvCeTfca5WUHcuVi2lT9VjygFs1ILG4RyeX1BXUumu\n' +
+  'Y8fzmposxLYdMxCqUTzAn0u9Saq2H2OVj5u114wS7OQPigu6G99dpn/iPHa3zBm8\n' +
+  '7baBWDbqZWRW0BP3K6eqq8sut1+NLhNW8ADPTdnO/SO+kvXy7fqd8atSn+HlQcx6\n' +
+  'tW42dhXf3E9uE7K78eZtW0KvfyNGAjsI1Fft2QIDAQABAoIBAG1exe3/LEBrPLfb\n' +
+  'U8iRdY0lxFvHYIhDgIwohC3wUdMYb5SMurpNdEZn+7Sh/fkUVgp/GKJViu1mvh52\n' +
+  'bKd2r52DwG9NQBQjVgkqY/auRYSglIPpr8PpYNSZlcneunCDGeqEY9hMmXc5Ssqs\n' +
+  'PQYoEKKPN+IlDTg6PguDgAfLR4IUvt9KXVvmB/SSgV9tSeTy35LECt1Lq3ozbUgu\n' +
+  '30HZI3U6/7H+X22Pxxf8vzBtzkg5rRCLgv+OeNPo16xMnqbutt4TeqEkxRv5rtOo\n' +
+  '/A1i9khBeki0OJAFJsE82qnaSZodaRsxic59VnN8sWBwEKAt87tEu5A3K3j4XSDU\n' +
+  '/avZxAECgYEA+pS3DvpiQLtHlaO3nAH6MxHRrREOARXWRDe5nUQuUNpS1xq9wte6\n' +
+  'DkFtba0UCvDLic08xvReTCbo9kH0y6zEy3zMpZuJlKbcWCkZf4S5miYPI0RTZtF8\n' +
+  'yps6hWqzYFSiO9hMYws9k4OJLxX0x3sLK7iNZ32ujcSrkPBSiBr0gxkCgYEA0dWl\n' +
+  '637K41AJ/zy0FP0syq+r4eIkfqv+/t6y2aQVUBvxJYrj9ci6XHBqoxpDV8lufVYj\n' +
+  'fUAfeI9/MZaWvQJRbnYLre0I6PJfLuCBIL5eflO77BGso165AF7QJZ+fwtgKv3zv\n' +
+  'ZX75eudCSS/cFo0po9hlbcLMT4B82zEkgT8E2MECgYEAnz+3/wrdOmpLGiyL2dff\n' +
+  '3GjsqmJ2VfY8z+niSrI0BSpbD11tT9Ct67VlCBjA7hsOH6uRfpd6/kaUMzzDiFVq\n' +
+  'VDAiFvV8QD6zNkwYalQ9aFvbrvwTTPrBpjl0vamMCiJ/YC0cjq1sGr2zh3sar1Ph\n' +
+  'S43kP+s97dcZeelhaiJHVrECgYEAsx61q/loJ/LDFeYzs1cLTVn4V7I7hQY9fkOM\n' +
+  'WM0AhInVqD6PqdfXfeFYpjJdGisQ7l0BnoGGW9vir+nkcyPvb2PFRIr6+B8tsU5j\n' +
+  '7BeVgjDoUfQkcrEBK5fEBtnj/ud9BUkY8oMZZBjVNLRuI7IMwZiPvMp0rcj4zAN/\n' +
+  'LfUlpgECgYArBvFcBxSkNAzR3Rtteud1YDboSKluRM37Ey5plrn4BS0DD0jm++aD\n' +
+  '0pG2Hsik000hibw92lCkzvvBVAqF8BuAcnPlAeYfsOaa97PGEjSKEN5bJVWZ9/om\n' +
+  '9FV1axotRN2XWlwrhixZLEaagkREXhgQc540FS5O8IaI2Vpa80Atzg==\n' +
+  '-----END RSA PRIVATE KEY-----'
+
+var publicKeyPEMs = {}
+
+publicKeyPEMs['key-1'] =
+  '-----BEGIN PUBLIC KEY-----\n' +
+  'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzWSJl+Z9Bqv00FVL5N3+\n' +
+  'JCUoqmQPjIlya1BbeqQroNQ5yG1iVbYTTnMRa1zQtR6r2fNvWeg94DvxivxIG9di\n' +
+  'DMnrzijAnYlTLOl84CK2vOxkj5b68zrLH9b/Gd6NOHsywo8IjvXvCeTfca5WUHcu\n' +
+  'Vi2lT9VjygFs1ILG4RyeX1BXUumuY8fzmposxLYdMxCqUTzAn0u9Saq2H2OVj5u1\n' +
+  '14wS7OQPigu6G99dpn/iPHa3zBm87baBWDbqZWRW0BP3K6eqq8sut1+NLhNW8ADP\n' +
+  'TdnO/SO+kvXy7fqd8atSn+HlQcx6tW42dhXf3E9uE7K78eZtW0KvfyNGAjsI1Fft\n' +
+  '2QIDAQAB\n' +
+  '-----END PUBLIC KEY-----'
+
+publicKeyPEMs['key-2'] =
+  '-----BEGIN PUBLIC KEY-----\n' +
+  'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqp04VVr9OThli9b35Omz\n' +
+  'VqSfWbsoQuRrgyWsrNRn3XkFmbWw4FzZwQ42OgGMzQ84Ta4d9zGKKQyFriTiPjPf\n' +
+  'xhhrsaJnDuybcpVhcr7UNKjSZ0S59tU3hpRiEz6hO+Nc/OSSLkvalG0VKrxOln7J\n' +
+  'LK/h3rNS/l6wDZ5S/KqsI6CYtV2ZLpn3ahLrizvEYNY038Qcm38qMWx+VJAvZ4di\n' +
+  'qqmW7RLIsLT59SWmpXdhFKnkYYGhxrk1Mwl22dBTJNY5SbriU5G3gWgzYkm8pgHr\n' +
+  '6CtrXch9ciJAcDJehPrKXNvNDOdUh8EW3fekNJerF1lWcwQg44/12v8sDPyfbaKB\n' +
+  'dQIDAQAB\n' +
+  '-----END PUBLIC KEY-----'
+
+var server = createServer(function (req, res) {
+  var parsed = httpSignature.parseRequest(req)
+  var publicKeyPEM = publicKeyPEMs[parsed.keyId]
+  var verified = httpSignature.verifySignature(parsed, publicKeyPEM)
+  res.writeHead(verified ? 200 : 400)
+  res.end()
+})
+
+server.listen(8080, function () {
+  function correctKeyTest(callback) {
+    var options = {
+      httpSignature: {
+        keyId: 'key-1',
+        key: privateKeyPEMs['key-1']
+      }
+    }
+    request('http://localhost:8080', options, function (e, r, b) {
+      assert.equal(200, r.statusCode)
+      callback()
+    })
+  }
+
+  function incorrectKeyTest(callback) {
+    var options = {
+      httpSignature: {
+        keyId: 'key-2',
+        key: privateKeyPEMs['key-1']
+      }
+    }
+    request('http://localhost:8080', options, function (e, r, b) {
+      assert.equal(400, r.statusCode)
+      callback()
+    })
+  }
+
+  var tests = [correctKeyTest, incorrectKeyTest]
+  var todo = tests.length;
+  for(var i = 0; i < tests.length; ++i) {
+    tests[i](function() {
+      if(!--todo) {
+        server.close()
+      }
+    })
+  }
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-httpModule.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-httpModule.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-httpModule.js	(revision 487)
@@ -0,0 +1,94 @@
+var http = require('http')
+  , https = require('https')
+  , server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+
+
+var faux_requests_made = {'http':0, 'https':0}
+function wrap_request(name, module) {
+  // Just like the http or https module, but note when a request is made.
+  var wrapped = {}
+  Object.keys(module).forEach(function(key) {
+    var value = module[key];
+
+    if(key != 'request')
+      wrapped[key] = value;
+    else
+      wrapped[key] = function(options, callback) {
+        faux_requests_made[name] += 1
+        return value.apply(this, arguments)
+      }
+  })
+
+  return wrapped;
+}
+
+
+var faux_http = wrap_request('http', http)
+  , faux_https = wrap_request('https', https)
+  , plain_server = server.createServer()
+  , https_server = server.createSSLServer()
+
+
+plain_server.listen(plain_server.port, function() {
+  plain_server.on('/plain', function (req, res) {
+    res.writeHead(200)
+    res.end('plain')
+  })
+  plain_server.on('/to_https', function (req, res) {
+    res.writeHead(301, {'location':'https://localhost:'+https_server.port + '/https'})
+    res.end()
+  })
+
+  https_server.listen(https_server.port, function() {
+    https_server.on('/https', function (req, res) {
+      res.writeHead(200)
+      res.end('https')
+    })
+    https_server.on('/to_plain', function (req, res) {
+      res.writeHead(302, {'location':'http://localhost:'+plain_server.port + '/plain'})
+      res.end()
+    })
+
+    run_tests()
+    run_tests({})
+    run_tests({'http:':faux_http})
+    run_tests({'https:':faux_https})
+    run_tests({'http:':faux_http, 'https:':faux_https})
+  })
+})
+
+function run_tests(httpModules) {
+  var to_https = 'http://localhost:'+plain_server.port+'/to_https'
+  var to_plain = 'https://localhost:'+https_server.port+'/to_plain'
+
+  request(to_https, {'httpModules':httpModules, strictSSL:false}, function (er, res, body) {
+    if (er) throw er
+    assert.equal(body, 'https', 'Received HTTPS server body')
+    done()
+  })
+
+  request(to_plain, {'httpModules':httpModules, strictSSL:false}, function (er, res, body) {
+    if (er) throw er
+    assert.equal(body, 'plain', 'Received HTTPS server body')
+    done()
+  })
+}
+
+
+var passed = 0;
+function done() {
+  passed += 1
+  var expected = 10
+
+  if(passed == expected) {
+    plain_server.close()
+    https_server.close()
+
+    assert.equal(faux_requests_made.http, 4, 'Wrapped http module called appropriately')
+    assert.equal(faux_requests_made.https, 4, 'Wrapped https module called appropriately')
+
+    console.log((expected+2) + ' tests passed.')
+  }
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-https-strict.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-https-strict.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-https-strict.js	(revision 487)
@@ -0,0 +1,97 @@
+// a test where we validate the siguature of the keys
+// otherwise exactly the same as the ssl test
+
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+  , fs = require('fs')
+  , path = require('path')
+  , opts = { key: path.resolve(__dirname, 'ssl/ca/server.key')
+           , cert: path.resolve(__dirname, 'ssl/ca/server.crt') }
+  , s = server.createSSLServer(null, opts)
+  , caFile = path.resolve(__dirname, 'ssl/ca/ca.crt')
+  , ca = fs.readFileSync(caFile)
+
+var tests =
+  { testGet :
+    { resp : server.createGetResponse("TESTING!")
+    , expectBody: "TESTING!"
+    }
+  , testGetChunkBreak :
+    { resp : server.createChunkResponse(
+      [ new Buffer([239])
+      , new Buffer([163])
+      , new Buffer([191])
+      , new Buffer([206])
+      , new Buffer([169])
+      , new Buffer([226])
+      , new Buffer([152])
+      , new Buffer([131])
+      ])
+    , expectBody: "ï£¿Î©â"
+    }
+  , testGetJSON :
+    { resp : server.createGetResponse('{"test":true}', 'application/json')
+    , json : true
+    , expectBody: {"test":true}
+    }
+  , testPutString :
+    { resp : server.createPostValidator("PUTTINGDATA")
+    , method : "PUT"
+    , body : "PUTTINGDATA"
+    }
+  , testPutBuffer :
+    { resp : server.createPostValidator("PUTTINGDATA")
+    , method : "PUT"
+    , body : new Buffer("PUTTINGDATA")
+    }
+  , testPutJSON :
+    { resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
+    , method: "PUT"
+    , json: {foo: 'bar'}
+    }
+  , testPutMultipart :
+    { resp: server.createPostValidator(
+        '--__BOUNDARY__\r\n' +
+        'content-type: text/html\r\n' +
+        '\r\n' +
+        '<html><body>Oh hi.</body></html>' +
+        '\r\n--__BOUNDARY__\r\n\r\n' +
+        'Oh hi.' +
+        '\r\n--__BOUNDARY__--'
+        )
+    , method: "PUT"
+    , multipart:
+      [ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
+      , {'body': 'Oh hi.'}
+      ]
+    }
+  }
+
+s.listen(s.port, function () {
+
+  var counter = 0
+
+  for (i in tests) {
+    (function () {
+      var test = tests[i]
+      s.on('/'+i, test.resp)
+      test.uri = s.url + '/' + i
+      test.strictSSL = true
+      test.ca = ca
+      test.headers = { host: 'testing.request.mikealrogers.com' }
+      request(test, function (err, resp, body) {
+        if (err) throw err
+        if (test.expectBody) {
+          assert.deepEqual(test.expectBody, body)
+        }
+        counter = counter - 1;
+        if (counter === 0) {
+          console.log(Object.keys(tests).length+" tests passed.")
+          s.close()
+        }
+      })
+      counter++
+    })()
+  }
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-https.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-https.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-https.js	(revision 487)
@@ -0,0 +1,87 @@
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+
+var s = server.createSSLServer();
+
+var tests =
+  { testGet :
+    { resp : server.createGetResponse("TESTING!")
+    , expectBody: "TESTING!"
+    }
+  , testGetChunkBreak :
+    { resp : server.createChunkResponse(
+      [ new Buffer([239])
+      , new Buffer([163])
+      , new Buffer([191])
+      , new Buffer([206])
+      , new Buffer([169])
+      , new Buffer([226])
+      , new Buffer([152])
+      , new Buffer([131])
+      ])
+    , expectBody: "ï£¿Î©â"
+    }
+  , testGetJSON :
+    { resp : server.createGetResponse('{"test":true}', 'application/json')
+    , json : true
+    , expectBody: {"test":true}
+    }
+  , testPutString :
+    { resp : server.createPostValidator("PUTTINGDATA")
+    , method : "PUT"
+    , body : "PUTTINGDATA"
+    }
+  , testPutBuffer :
+    { resp : server.createPostValidator("PUTTINGDATA")
+    , method : "PUT"
+    , body : new Buffer("PUTTINGDATA")
+    }
+  , testPutJSON :
+    { resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
+    , method: "PUT"
+    , json: {foo: 'bar'}
+    }
+  , testPutMultipart :
+    { resp: server.createPostValidator(
+        '--__BOUNDARY__\r\n' +
+        'content-type: text/html\r\n' +
+        '\r\n' +
+        '<html><body>Oh hi.</body></html>' +
+        '\r\n--__BOUNDARY__\r\n\r\n' +
+        'Oh hi.' +
+        '\r\n--__BOUNDARY__--'
+        )
+    , method: "PUT"
+    , multipart:
+      [ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
+      , {'body': 'Oh hi.'}
+      ]
+    }
+  }
+
+s.listen(s.port, function () {
+
+  var counter = 0
+
+  for (i in tests) {
+    (function () {
+      var test = tests[i]
+      s.on('/'+i, test.resp)
+      test.uri = s.url + '/' + i
+      test.rejectUnauthorized = false
+      request(test, function (err, resp, body) {
+        if (err) throw err
+        if (test.expectBody) {
+          assert.deepEqual(test.expectBody, body)
+        }
+        counter = counter - 1;
+        if (counter === 0) {
+          console.log(Object.keys(tests).length+" tests passed.")
+          s.close()
+        }
+      })
+      counter++
+    })()
+  }
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-localAddress.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-localAddress.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-localAddress.js	(revision 487)
@@ -0,0 +1,15 @@
+var request = require('../index')
+  , assert = require('assert')
+  ;
+
+request.get({
+  uri: 'http://www.google.com', localAddress: '1.2.3.4' // some invalid address
+}, function(err, res) {
+  assert(!res) // asserting that no response received
+})
+
+request.get({
+  uri: 'http://www.google.com', localAddress: '127.0.0.1'
+}, function(err, res) {
+  assert(!res) // asserting that no response received
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-oauth.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-oauth.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-oauth.js	(revision 487)
@@ -0,0 +1,117 @@
+var hmacsign = require('oauth-sign').hmacsign
+  , assert = require('assert')
+  , qs = require('querystring')
+  , request = require('../index')
+  ;
+
+function getsignature (r) {
+  var sign
+  r.headers.Authorization.slice('OAuth '.length).replace(/,\ /g, ',').split(',').forEach(function (v) {
+    if (v.slice(0, 'oauth_signature="'.length) === 'oauth_signature="') sign = v.slice('oauth_signature="'.length, -1)
+  })
+  return decodeURIComponent(sign)
+}
+
+// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth
+
+var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', 
+  { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11'
+  , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
+  , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk'
+  , oauth_signature_method: 'HMAC-SHA1'
+  , oauth_timestamp: '1272323042'
+  , oauth_version: '1.0'
+  }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98")
+
+console.log(reqsign)
+console.log('8wUi7m5HFQy76nowoCThusfgB+Q=')
+assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=')
+
+var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token',
+  { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g'
+  , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8'
+  , oauth_signature_method: 'HMAC-SHA1'
+  , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc'
+  , oauth_timestamp: '1272323047'
+  , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY'
+  , oauth_version: '1.0'
+  }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA")
+  
+console.log(accsign)
+console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
+assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=')
+
+var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', 
+  { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g"
+  , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y"
+  , oauth_signature_method: "HMAC-SHA1"
+  , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw"
+  , oauth_timestamp: "1272325550"
+  , oauth_version: "1.0"
+  , status: 'setting up my twitter ç§ã®ãããããèš­å®ãã'
+  }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA")
+
+console.log(upsign)
+console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=')
+
+
+var rsign = request.post(
+  { url: 'https://api.twitter.com/oauth/request_token'
+  , oauth: 
+    { callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11'
+    , consumer_key: 'GDdmIQH6jhtmLUypg82g'
+    , nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk'
+    , timestamp: '1272323042'
+    , version: '1.0'
+    , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98"
+    }
+  })
+
+setTimeout(function () {
+  console.log(getsignature(rsign))
+  assert.equal(reqsign, getsignature(rsign))
+})
+
+var raccsign = request.post(
+  { url: 'https://api.twitter.com/oauth/access_token'
+  , oauth:  
+    { consumer_key: 'GDdmIQH6jhtmLUypg82g'
+    , nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8'
+    , signature_method: 'HMAC-SHA1'
+    , token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc'
+    , timestamp: '1272323047'
+    , verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY'
+    , version: '1.0'
+    , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98"
+    , token_secret: "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA" 
+    }
+  })
+
+setTimeout(function () {
+  console.log(getsignature(raccsign))
+  assert.equal(accsign, getsignature(raccsign))
+}, 1) 
+
+var rupsign = request.post(
+  { url: 'http://api.twitter.com/1/statuses/update.json' 
+  , oauth: 
+    { consumer_key: "GDdmIQH6jhtmLUypg82g"
+    , nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y"
+    , signature_method: "HMAC-SHA1"
+    , token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw"
+    , timestamp: "1272325550"
+    , version: "1.0"
+    , consumer_secret: "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98"
+    , token_secret: "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA"
+    }
+  , form: {status: 'setting up my twitter ç§ã®ãããããèš­å®ãã'} 
+  })
+setTimeout(function () {
+  console.log(getsignature(rupsign))
+  assert.equal(upsign, getsignature(rupsign))
+}, 1)
+
+
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-onelineproxy.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-onelineproxy.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-onelineproxy.js	(revision 487)
@@ -0,0 +1,46 @@
+var http = require('http')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var server = http.createServer(function (req, resp) {
+  resp.statusCode = 200
+  if (req.url === '/get') {
+    assert.equal(req.method, 'GET')
+    resp.write('content')
+    resp.end()
+    return
+  }
+  if (req.url === '/put') {
+    var x = ''
+    assert.equal(req.method, 'PUT')
+    req.on('data', function (chunk) {
+      x += chunk
+    })
+    req.on('end', function () {
+      assert.equal(x, 'content')
+      resp.write('success')
+      resp.end()
+    })
+    return
+  }
+  if (req.url === '/proxy') {
+    assert.equal(req.method, 'PUT')
+    return req.pipe(request('http://localhost:8080/put')).pipe(resp)
+  }
+
+  if (req.url === '/test') {
+    return request('http://localhost:8080/get').pipe(request.put('http://localhost:8080/proxy')).pipe(resp)
+  }
+  throw new Error('Unknown url', req.url)
+}).listen(8080, function () {
+  request('http://localhost:8080/test', function (e, resp, body) {
+    if (e) throw e
+    if (resp.statusCode !== 200) throw new Error('statusCode not 200 ' + resp.statusCode)
+    assert.equal(body, 'success')
+    server.close()
+  })
+})
+
+
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-params.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-params.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-params.js	(revision 487)
@@ -0,0 +1,93 @@
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var s = server.createServer();
+
+var tests =
+  { testGet :
+    { resp : server.createGetResponse("TESTING!")
+    , expectBody: "TESTING!"
+    }
+    , testGetChunkBreak :
+      { resp : server.createChunkResponse(
+        [ new Buffer([239])
+        , new Buffer([163])
+        , new Buffer([191])
+        , new Buffer([206])
+        , new Buffer([169])
+        , new Buffer([226])
+        , new Buffer([152])
+        , new Buffer([131])
+        ])
+      , expectBody: "ï£¿Î©â"
+      }
+    , testGetBuffer :
+      { resp : server.createGetResponse(new Buffer("TESTING!"))
+      , encoding: null
+      , expectBody: new Buffer("TESTING!")
+      }
+    , testGetJSON :
+       { resp : server.createGetResponse('{"test":true}', 'application/json')
+       , json : true
+       , expectBody: {"test":true}
+       }
+    , testPutString :
+      { resp : server.createPostValidator("PUTTINGDATA")
+      , method : "PUT"
+      , body : "PUTTINGDATA"
+      }
+    , testPutBuffer :
+      { resp : server.createPostValidator("PUTTINGDATA")
+      , method : "PUT"
+      , body : new Buffer("PUTTINGDATA")
+      }
+    , testPutJSON :
+      { resp : server.createPostValidator(JSON.stringify({foo: 'bar'}))
+      , method: "PUT"
+      , json: {foo: 'bar'}
+      }
+    , testPutMultipart :
+      { resp: server.createPostValidator(
+          '--__BOUNDARY__\r\n' +
+          'content-type: text/html\r\n' +
+          '\r\n' +
+          '<html><body>Oh hi.</body></html>' +
+          '\r\n--__BOUNDARY__\r\n\r\n' +
+          'Oh hi.' +
+          '\r\n--__BOUNDARY__--'
+          )
+      , method: "PUT"
+      , multipart:
+        [ {'content-type': 'text/html', 'body': '<html><body>Oh hi.</body></html>'}
+        , {'body': 'Oh hi.'}
+        ]
+      }
+  }
+
+s.listen(s.port, function () {
+
+  var counter = 0
+
+  for (i in tests) {
+    (function () {
+      var test = tests[i]
+      s.on('/'+i, test.resp)
+      //test.uri = s.url + '/' + i
+      request(s.url + '/' + i, test, function (err, resp, body) {
+        if (err) throw err
+        if (test.expectBody) {
+          assert.deepEqual(test.expectBody, body)
+        }
+        counter = counter - 1;
+        if (counter === 0) {
+          assert.notEqual(typeof test.callback, 'function')
+          console.log(1 + Object.keys(tests).length+" tests passed.")
+          s.close()
+        }
+      })
+      counter++
+    })()
+  }
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-piped-redirect.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-piped-redirect.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-piped-redirect.js	(revision 487)
@@ -0,0 +1,42 @@
+var http = require('http')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var portOne = 8968
+  , portTwo = 8969
+  ;
+
+
+// server one
+var s1 = http.createServer(function (req, resp) {
+  if (req.url == '/original') {
+    resp.writeHeader(302, {'location': '/redirected'})
+    resp.end()
+  } else if (req.url == '/redirected') {
+    resp.writeHeader(200, {'content-type': 'text/plain'})
+    resp.write('OK')
+    resp.end()
+  }
+
+}).listen(portOne);
+
+
+// server two
+var s2 = http.createServer(function (req, resp) {
+  var x = request('http://localhost:'+portOne+'/original')
+  req.pipe(x)
+  x.pipe(resp)
+
+}).listen(portTwo, function () {
+  var r = request('http://localhost:'+portTwo+'/original', function (err, res, body) {
+    assert.equal(body, 'OK')
+
+    s1.close()
+    s2.close()
+  });
+
+  // it hangs, so wait a second :)
+  r.timeout = 1000;
+
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-pipes.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-pipes.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-pipes.js	(revision 487)
@@ -0,0 +1,216 @@
+var server = require('./server')
+  , events = require('events')
+  , stream = require('stream')
+  , assert = require('assert')
+  , fs = require('fs')
+  , request = require('../index')
+  , path = require('path')
+  , util = require('util')
+  ;
+
+var s = server.createServer(3453);
+
+function ValidationStream(str) {
+  this.str = str
+  this.buf = ''
+  this.on('data', function (data) {
+    this.buf += data
+  })
+  this.on('end', function () {
+    assert.equal(this.str, this.buf)
+  })
+  this.writable = true
+}
+util.inherits(ValidationStream, stream.Stream)
+ValidationStream.prototype.write = function (chunk) {
+  this.emit('data', chunk)
+}
+ValidationStream.prototype.end = function (chunk) {
+  if (chunk) emit('data', chunk)
+  this.emit('end')
+}
+
+s.listen(s.port, function () {
+  counter = 0;
+
+  var check = function () {
+    counter = counter - 1
+    if (counter === 0) {
+      console.log('All tests passed.')
+      setTimeout(function () {
+        process.exit();
+      }, 500)
+    }
+  }
+
+  // Test pipeing to a request object
+  s.once('/push', server.createPostValidator("mydata"));
+
+  var mydata = new stream.Stream();
+  mydata.readable = true
+
+  counter++
+  var r1 = request.put({url:'http://localhost:3453/push'}, function () {
+    check();
+  })
+  mydata.pipe(r1)
+
+  mydata.emit('data', 'mydata');
+  mydata.emit('end');
+
+  // Test pipeing to a request object with a json body
+  s.once('/push-json', server.createPostValidator("{\"foo\":\"bar\"}", "application/json"));
+
+  var mybodydata = new stream.Stream();
+  mybodydata.readable = true
+
+  counter++
+  var r2 = request.put({url:'http://localhost:3453/push-json',json:true}, function () {
+    check();
+  })
+  mybodydata.pipe(r2)
+
+  mybodydata.emit('data', JSON.stringify({foo:"bar"}));
+  mybodydata.emit('end');
+
+  // Test pipeing from a request object.
+  s.once('/pull', server.createGetResponse("mypulldata"));
+
+  var mypulldata = new stream.Stream();
+  mypulldata.writable = true
+
+  counter++
+  request({url:'http://localhost:3453/pull'}).pipe(mypulldata)
+
+  var d = '';
+
+  mypulldata.write = function (chunk) {
+    d += chunk;
+  }
+  mypulldata.end = function () {
+    assert.equal(d, 'mypulldata');
+    check();
+  };
+
+
+  s.on('/cat', function (req, resp) {
+    if (req.method === "GET") {
+      resp.writeHead(200, {'content-type':'text/plain-test', 'content-length':4});
+      resp.end('asdf')
+    } else if (req.method === "PUT") {
+      assert.equal(req.headers['content-type'], 'text/plain-test');
+      assert.equal(req.headers['content-length'], 4)
+      var validate = '';
+
+      req.on('data', function (chunk) {validate += chunk})
+      req.on('end', function () {
+        resp.writeHead(201);
+        resp.end();
+        assert.equal(validate, 'asdf');
+        check();
+      })
+    }
+  })
+  s.on('/pushjs', function (req, resp) {
+    if (req.method === "PUT") {
+      assert.equal(req.headers['content-type'], 'application/javascript');
+      check();
+    }
+  })
+  s.on('/catresp', function (req, resp) {
+    request.get('http://localhost:3453/cat').pipe(resp)
+  })
+  s.on('/doodle', function (req, resp) {
+    if (req.headers['x-oneline-proxy']) {
+      resp.setHeader('x-oneline-proxy', 'yup')
+    }
+    resp.writeHead('200', {'content-type':'image/jpeg'})
+    fs.createReadStream(path.join(__dirname, 'googledoodle.jpg')).pipe(resp)
+  })
+  s.on('/onelineproxy', function (req, resp) {
+    var x = request('http://localhost:3453/doodle')
+    req.pipe(x)
+    x.pipe(resp)
+  })
+
+  counter++
+  fs.createReadStream(__filename).pipe(request.put('http://localhost:3453/pushjs'))
+
+  counter++
+  request.get('http://localhost:3453/cat').pipe(request.put('http://localhost:3453/cat'))
+
+  counter++
+  request.get('http://localhost:3453/catresp', function (e, resp, body) {
+    assert.equal(resp.headers['content-type'], 'text/plain-test');
+    assert.equal(resp.headers['content-length'], 4)
+    check();
+  })
+
+  var doodleWrite = fs.createWriteStream(path.join(__dirname, 'test.jpg'))
+
+  counter++
+  request.get('http://localhost:3453/doodle').pipe(doodleWrite)
+
+  doodleWrite.on('close', function () {
+    assert.deepEqual(fs.readFileSync(path.join(__dirname, 'googledoodle.jpg')), fs.readFileSync(path.join(__dirname, 'test.jpg')))
+    check()
+  })
+
+  process.on('exit', function () {
+    fs.unlinkSync(path.join(__dirname, 'test.jpg'))
+  })
+
+  counter++
+  request.get({uri:'http://localhost:3453/onelineproxy', headers:{'x-oneline-proxy':'nope'}}, function (err, resp, body) {
+    assert.equal(resp.headers['x-oneline-proxy'], 'yup')
+    check()
+  })
+
+  s.on('/afterresponse', function (req, resp) {
+    resp.write('d')
+    resp.end()
+  })
+
+  counter++
+  var afterresp = request.post('http://localhost:3453/afterresponse').on('response', function () {
+    var v = new ValidationStream('d')
+    afterresp.pipe(v)
+    v.on('end', check)
+  })
+  
+  s.on('/forward1', function (req, resp) {
+   resp.writeHead(302, {location:'/forward2'})
+    resp.end()
+  })
+  s.on('/forward2', function (req, resp) {
+    resp.writeHead('200', {'content-type':'image/png'})
+    resp.write('d')
+    resp.end()
+  })
+  
+  counter++
+  var validateForward = new ValidationStream('d')
+  validateForward.on('end', check)
+  request.get('http://localhost:3453/forward1').pipe(validateForward)
+
+  // Test pipe options
+  s.once('/opts', server.createGetResponse('opts response'));
+
+  var optsStream = new stream.Stream();
+  optsStream.writable = true
+  
+  var optsData = '';
+  optsStream.write = function (buf) {
+    optsData += buf;
+    if (optsData === 'opts response') {
+      setTimeout(check, 10);
+    }
+  }
+
+  optsStream.end = function () {
+    assert.fail('end called')
+  };
+
+  counter++
+  request({url:'http://localhost:3453/opts'}).pipe(optsStream, { end : false })
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-pool.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-pool.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-pool.js	(revision 487)
@@ -0,0 +1,16 @@
+var request = require('../index')
+  , http = require('http')
+  , assert = require('assert')
+  ;
+
+var s = http.createServer(function (req, resp) {
+  resp.statusCode = 200;
+  resp.end('asdf');
+}).listen(8080, function () {
+  request({'url': 'http://localhost:8080', 'pool': false}, function (e, resp) {
+    var agent = resp.request.agent;
+    assert.strictEqual(typeof agent, 'boolean');
+    assert.strictEqual(agent, false);
+    s.close();
+  });
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-protocol-changing-redirect.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-protocol-changing-redirect.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-protocol-changing-redirect.js	(revision 487)
@@ -0,0 +1,61 @@
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+
+
+var s = server.createServer()
+var ss = server.createSSLServer()
+var sUrl = 'http://localhost:' + s.port
+var ssUrl = 'https://localhost:' + ss.port
+
+s.listen(s.port, bouncy(s, ssUrl))
+ss.listen(ss.port, bouncy(ss, sUrl))
+
+var hits = {}
+var expect = {}
+var pending = 0
+function bouncy (s, server) { return function () {
+
+  var redirs = { a: 'b'
+               , b: 'c'
+               , c: 'd'
+               , d: 'e'
+               , e: 'f'
+               , f: 'g'
+               , g: 'h'
+               , h: 'end' }
+
+  var perm = true
+  Object.keys(redirs).forEach(function (p) {
+    var t = redirs[p]
+
+    // switch type each time
+    var type = perm ? 301 : 302
+    perm = !perm
+    s.on('/' + p, function (req, res) {
+      res.writeHead(type, { location: server + '/' + t })
+      res.end()
+    })
+  })
+
+  s.on('/end', function (req, res) {
+    var h = req.headers['x-test-key']
+    hits[h] = true
+    pending --
+    if (pending === 0) done()
+  })
+}}
+
+for (var i = 0; i < 5; i ++) {
+  pending ++
+  var val = 'test_' + i
+  expect[val] = true
+  request({ url: (i % 2 ? sUrl : ssUrl) + '/a'
+          , headers: { 'x-test-key': val }
+          , rejectUnauthorized: false })
+}
+
+function done () {
+  assert.deepEqual(hits, expect)
+  process.exit(0)
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-proxy.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-proxy.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-proxy.js	(revision 487)
@@ -0,0 +1,39 @@
+var server = require('./server')
+  , events = require('events')
+  , stream = require('stream')
+  , assert = require('assert')
+  , fs = require('fs')
+  , request = require('../index')
+  , path = require('path')
+  , util = require('util')
+  ;
+
+var port = 6768
+  , called = false
+  , proxiedHost = 'google.com'
+  ;
+
+var s = server.createServer(port)
+s.listen(port, function () {
+  s.on('http://google.com/', function (req, res) {
+    called = true
+    assert.equal(req.headers.host, proxiedHost)
+    res.writeHeader(200)
+    res.end()
+  })
+  request ({
+    url: 'http://'+proxiedHost,
+    proxy: 'http://localhost:'+port
+    /*
+    //should behave as if these arguments where passed:
+    url: 'http://localhost:'+port,
+    headers: {host: proxiedHost}
+    //*/
+  }, function (err, res, body) {
+    s.close()
+  })
+})
+
+process.on('exit', function () {
+  assert.ok(called, 'the request must be made to the proxy server')
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-qs.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-qs.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-qs.js	(revision 487)
@@ -0,0 +1,42 @@
+var request = request = require('../index')
+  , assert = require('assert')
+  ;
+ 
+
+// Test adding a querystring
+var req1 = request.get({ uri: 'http://www.google.com', qs: { q : 'search' }})
+setTimeout(function() {
+	assert.equal('/?q=search', req1.path)
+}, 1)
+
+// Test replacing a querystring value
+var req2 = request.get({ uri: 'http://www.google.com?q=abc', qs: { q : 'search' }})
+setTimeout(function() {
+	assert.equal('/?q=search', req2.path)
+}, 1)
+
+// Test appending a querystring value to the ones present in the uri
+var req3 = request.get({ uri: 'http://www.google.com?x=y', qs: { q : 'search' }})
+setTimeout(function() {
+	assert.equal('/?x=y&q=search', req3.path)
+}, 1)
+
+// Test leaving a querystring alone
+var req4 = request.get({ uri: 'http://www.google.com?x=y'})
+setTimeout(function() {
+	assert.equal('/?x=y', req4.path)
+}, 1)
+
+// Test giving empty qs property
+var req5 = request.get({ uri: 'http://www.google.com', qs: {}})
+setTimeout(function(){
+	assert.equal('/', req5.path)
+}, 1)
+
+
+// Test modifying the qs after creating the request
+var req6 = request.get({ uri: 'http://www.google.com', qs: {}});
+req6.qs({ q: "test" });
+process.nextTick(function() {
+    assert.equal('/?q=test', req6.path);
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-redirect.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-redirect.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-redirect.js	(revision 487)
@@ -0,0 +1,155 @@
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+  , Cookie = require('cookie-jar')
+  , Jar = Cookie.Jar
+  ;
+
+var s = server.createServer()
+
+s.listen(s.port, function () {
+  var server = 'http://localhost:' + s.port;
+  var hits = {}
+  var passed = 0;
+
+  bouncer(301, 'temp')
+  bouncer(302, 'perm')
+  bouncer(302, 'nope')
+
+  function bouncer(code, label) {
+    var landing = label+'_landing';
+
+    s.on('/'+label, function (req, res) {
+      hits[label] = true;
+      res.writeHead(code, {
+        'location':server + '/'+landing,
+        'set-cookie': 'ham=eggs'
+      })
+      res.end()
+    })
+
+    s.on('/'+landing, function (req, res) {
+      if (req.method !== 'GET') { // We should only accept GET redirects
+        console.error("Got a non-GET request to the redirect destination URL");
+        res.writeHead(400);
+        res.end();
+        return;
+      }
+      // Make sure the cookie doesn't get included twice, see #139:
+      // Make sure cookies are set properly after redirect
+      assert.equal(req.headers.cookie, 'foo=bar; quux=baz; ham=eggs');
+      hits[landing] = true;
+      res.writeHead(200)
+      res.end(landing)
+    })
+  }
+
+  // Permanent bounce
+  var jar = new Jar()
+  jar.add(new Cookie('quux=baz'))
+  request({uri: server+'/perm', jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode)
+    assert.ok(hits.perm, 'Original request is to /perm')
+    assert.ok(hits.perm_landing, 'Forward to permanent landing URL')
+    assert.equal(body, 'perm_landing', 'Got permanent landing content')
+    passed += 1
+    done()
+  })
+  
+  // Temporary bounce
+  request({uri: server+'/temp', jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode)
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(hits.temp_landing, 'Forward to temporary landing URL')
+    assert.equal(body, 'temp_landing', 'Got temporary landing content')
+    passed += 1
+    done()
+  })
+  
+  // Prevent bouncing.
+  request({uri:server+'/nope', jar: jar, headers: {cookie: 'foo=bar'}, followRedirect:false}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 302) throw new Error('Status is not 302: '+res.statusCode)
+    assert.ok(hits.nope, 'Original request to /nope')
+    assert.ok(!hits.nope_landing, 'No chasing the redirect')
+    assert.equal(res.statusCode, 302, 'Response is the bounce itself')
+    passed += 1
+    done()
+  })
+  
+  // Should not follow post redirects by default
+  request.post(server+'/temp', { jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode)
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(!hits.temp_landing, 'No chasing the redirect when post')
+    assert.equal(res.statusCode, 301, 'Response is the bounce itself')
+    passed += 1
+    done()
+  })
+  
+  // Should follow post redirects when followAllRedirects true
+  request.post({uri:server+'/temp', followAllRedirects:true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode)
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(hits.temp_landing, 'Forward to temporary landing URL')
+    assert.equal(body, 'temp_landing', 'Got temporary landing content')
+    passed += 1
+    done()
+  })
+  
+  request.post({uri:server+'/temp', followAllRedirects:false, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode)
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(!hits.temp_landing, 'No chasing the redirect')
+    assert.equal(res.statusCode, 301, 'Response is the bounce itself')
+    passed += 1
+    done()
+  })
+
+  // Should not follow delete redirects by default
+  request.del(server+'/temp', { jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode < 301) throw new Error('Status is not a redirect.')
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(!hits.temp_landing, 'No chasing the redirect when delete')
+    assert.equal(res.statusCode, 301, 'Response is the bounce itself')
+    passed += 1
+    done()
+  })
+  
+  // Should not follow delete redirects even if followRedirect is set to true
+  request.del(server+'/temp', { followRedirect: true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 301) throw new Error('Status is not 301: '+res.statusCode)
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(!hits.temp_landing, 'No chasing the redirect when delete')
+    assert.equal(res.statusCode, 301, 'Response is the bounce itself')
+    passed += 1
+    done()
+  })
+  
+  // Should follow delete redirects when followAllRedirects true
+  request.del(server+'/temp', {followAllRedirects:true, jar: jar, headers: {cookie: 'foo=bar'}}, function (er, res, body) {
+    if (er) throw er
+    if (res.statusCode !== 200) throw new Error('Status is not 200: '+res.statusCode)
+    assert.ok(hits.temp, 'Original request is to /temp')
+    assert.ok(hits.temp_landing, 'Forward to temporary landing URL')
+    assert.equal(body, 'temp_landing', 'Got temporary landing content')
+    passed += 1
+    done()
+  })
+
+  var reqs_done = 0;
+  function done() {
+    reqs_done += 1;
+    if(reqs_done == 9) {
+      console.log(passed + ' tests passed.')
+      s.close()
+    }
+  }
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-s3.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-s3.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-s3.js	(revision 487)
@@ -0,0 +1,13 @@
+var request = require('../index')
+
+var r = request.get('https://log.curlybracecast.com.s3.amazonaws.com/', 
+  { aws: 
+    { key: 'AKIAI6KIQRRVMGK3WK5Q'
+    , secret: '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'
+    , bucket: 'log.curlybracecast.com'
+    }
+  }, function (e, resp, body) {
+    console.log(r.headers)
+    console.log(body)
+  }
+)
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-timeout.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-timeout.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-timeout.js	(revision 487)
@@ -0,0 +1,87 @@
+var server = require('./server')
+  , events = require('events')
+  , stream = require('stream')
+  , assert = require('assert')
+  , request = require('../index')
+  ;
+
+var s = server.createServer();
+var expectedBody = "waited";
+var remainingTests = 5;
+
+s.listen(s.port, function () {
+  // Request that waits for 200ms
+  s.on('/timeout', function (req, resp) {
+    setTimeout(function(){
+      resp.writeHead(200, {'content-type':'text/plain'})
+      resp.write(expectedBody)
+      resp.end()
+    }, 200);
+  });
+
+  // Scenario that should timeout
+  var shouldTimeout = {
+    url: s.url + "/timeout",
+    timeout:100
+  }
+
+
+  request(shouldTimeout, function (err, resp, body) {
+    assert.equal(err.code, "ETIMEDOUT");
+    checkDone();
+  })
+
+
+  // Scenario that shouldn't timeout
+  var shouldntTimeout = {
+    url: s.url + "/timeout",
+    timeout:300
+  }
+
+  request(shouldntTimeout, function (err, resp, body) {
+    assert.equal(err, null);
+    assert.equal(expectedBody, body)
+    checkDone();
+  })
+
+  // Scenario with no timeout set, so shouldn't timeout
+  var noTimeout = {
+    url: s.url + "/timeout"
+  }
+
+  request(noTimeout, function (err, resp, body) {
+    assert.equal(err);
+    assert.equal(expectedBody, body)
+    checkDone();
+  })
+
+  // Scenario with a negative timeout value, should be treated a zero or the minimum delay
+  var negativeTimeout = {
+    url: s.url + "/timeout",
+    timeout:-1000
+  }
+
+  request(negativeTimeout, function (err, resp, body) {
+    assert.equal(err.code, "ETIMEDOUT");
+    checkDone();
+  })
+
+  // Scenario with a float timeout value, should be rounded by setTimeout anyway
+  var floatTimeout = {
+    url: s.url + "/timeout",
+    timeout: 100.76
+  }
+
+  request(floatTimeout, function (err, resp, body) {
+    assert.equal(err.code, "ETIMEDOUT");
+    checkDone();
+  })
+
+  function checkDone() {
+    if(--remainingTests == 0) {
+      s.close();
+      console.log("All tests passed.");
+    }
+  }
+})
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-toJSON.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-toJSON.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-toJSON.js	(revision 487)
@@ -0,0 +1,14 @@
+var request = require('../index')
+  , http = require('http')
+  , assert = require('assert')
+  ;
+
+var s = http.createServer(function (req, resp) {
+  resp.statusCode = 200
+  resp.end('asdf')
+}).listen(8080, function () {
+  var r = request('http://localhost:8080', function (e, resp) {
+    assert.equal(JSON.parse(JSON.stringify(r)).response.statusCode, 200)
+    s.close()
+  })
+})
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-tunnel.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-tunnel.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/request/tests/test-tunnel.js	(revision 487)
@@ -0,0 +1,75 @@
+// test that we can tunnel a https request over an http proxy
+// keeping all the CA and whatnot intact.
+//
+// Note: this requires that squid is installed.
+// If the proxy fails to start, we'll just log a warning and assume success.
+
+var server = require('./server')
+  , assert = require('assert')
+  , request = require('../index')
+  , fs = require('fs')
+  , path = require('path')
+  , caFile = path.resolve(__dirname, 'ssl/npm-ca.crt')
+  , ca = fs.readFileSync(caFile)
+  , child_process = require('child_process')
+  , sqConf = path.resolve(__dirname, 'squid.conf')
+  , sqArgs = ['-f', sqConf, '-N', '-d', '5']
+  , proxy = 'http://localhost:3128'
+  , hadError = null
+
+var squid = child_process.spawn('squid', sqArgs);
+var ready = false
+
+squid.stderr.on('data', function (c) {
+  console.error('SQUIDERR ' + c.toString().trim().split('\n')
+               .join('\nSQUIDERR '))
+  ready = c.toString().match(/ready to serve requests|Accepting HTTP Socket connections/i)
+})
+
+squid.stdout.on('data', function (c) {
+  console.error('SQUIDOUT ' + c.toString().trim().split('\n')
+               .join('\nSQUIDOUT '))
+})
+
+squid.on('error', function (c) {
+  console.error('squid: error '+c)
+  if (c && !ready) {
+    notInstalled()
+    return
+  }
+})
+
+squid.on('exit', function (c) {
+  console.error('squid: exit '+c)
+  if (c && !ready) {
+    notInstalled()
+    return
+  }
+
+  if (c) {
+    hadError = hadError || new Error('Squid exited with '+c)
+  }
+  if (hadError) throw hadError
+})
+
+setTimeout(function F () {
+  if (!ready) return setTimeout(F, 100)
+  request({ uri: 'https://registry.npmjs.org/'
+          , proxy: 'http://localhost:3128'
+          , strictSSL: true
+          , ca: ca
+          , json: true }, function (er, body) {
+    hadError = er
+    console.log(er || typeof body)
+    if (!er) console.log("ok")
+    squid.kill('SIGKILL')
+  })
+}, 100)
+
+function notInstalled() {
+  console.error('squid must be installed to run this test.')
+  console.error('skipping this test. please install squid and run again if you need to test tunneling.')
+  c = null
+  hadError = null
+  process.exit(0)
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/LICENSE-MIT
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/LICENSE-MIT	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/LICENSE-MIT	(revision 487)
@@ -0,0 +1,22 @@
+Copyright (c) 2013 Bart van der Schoor
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/README.md	(revision 487)
@@ -0,0 +1,127 @@
+# tv4-reporter
+
+[![Build Status](https://secure.travis-ci.org/Bartvds/tv4-reporter.png?branch=master)](http://travis-ci.org/Bartvds/tv4-reporter) [![Dependency Status](https://gemnasium.com/Bartvds/tv4-reporter.png)](https://gemnasium.com/Bartvds/tv4-reporter) [![NPM version](https://badge.fury.io/js/tv4-reporter.png)](http://badge.fury.io/js/tv4-reporter)
+
+> Reporters to display usable [Tiny Validator tv4](https://github.com/geraintluff/tv4) output of [json-schema](http://jsonschema.org) validation.
+ 
+This module is used by various dependants to render `tv4` validation result objects in a compact but highly readable (and possibly colourful) format. Functionality is tuned for both CLI output as well as plain-text or pre-formatted HTML/CSS. 
+
+**Note:** at this point this is *not* a 'validator' or 'test runner', nor is it a finished application. It is a library to use as dependency in `tv4` based testers. Use plain `tv4` and pass the result(s) to one of `tv4-reporters` helpers. If you are looking for a validator see one of the implementing tv4 wrappers for convenience (some linked below). 
+
+## Features
+
+* Indented, tree-like display.
+* Single and multiple errors.
+* Optionally display summaries.
+* Recursive sub-errors (as generated by `anyOf`, `oneOf` etc).
+* Missing sub-schemas (optionally report as fail or pass reason).
+* Various output writer/coloriser modes using [ministyle](https://github.com/Bartvds/ministyle) and [miniwrite](https://github.com/Bartvds/miniwrite).
+
+## Examples
+
+(possibly outdated)
+
+1. Examples of many different kind of errors in [this Travis-Ci build](https://travis-ci.org/Bartvds/grunt-tv4/jobs/14469941).
+1. Bulk reporter with single error:
+ 
+  [![WebStorm example](https://raw.github.com/Bartvds/tv4-reporter/master/media/webstorm-example-01.png)](https://raw.github.com/Bartvds/tv4-reporter/master/media/webstorm-example-01.png)
+
+## Installation
+
+```shell
+$ npm install tv4-reporter --save-dev
+```
+
+## Usage
+
+Still very-much in flux so possibly outdated examples. 
+
+Minimal use case (likely this is spread over the implementing application):
+````js
+// assemble the components
+var tv4 = require('tv4');
+var out = require('miniwrite').console();
+var style = require('ministyle').ansi();
+var reporter = require('tv4-reporter').getReporter(out, style);
+
+// now validate
+var result = tv4.validateMultiple(myValue, mySchema);
+if (!result.valid || result.missing.length > 0) {
+	// get data object (might get these in bulk/async from somewhere)
+	var res = reporter.createTest(mySchema, myValue, 'my special test', true);
+	
+	// report error
+	reporter.reportResult(res);
+
+	// if you have a many results you can use bulk to print nicely with summaries
+	reporter.reportBulk([res, res2, res3], [pass1, pass2]);
+	
+	// only totals
+	reporter.reportTotals(3, 4);
+}
+````
+
+Bulk reporting:
+````js
+// if you have a many results you can use bulk to print nicely with summaries
+reporter.reportBulk([res, res2, res3], [pass1, pass2]);
+
+// only totals
+reporter.reportTotals(3, 4);
+````
+
+For more API surface like (partial) reporter and various helpers see the exports in the main module. Also see the 'known dependants' for more examples.
+
+## Output
+
+Report output and styling done via extensible mini-api's:
+ 
+* [ministyle](https://github.com/Bartvds/ministyle) (bundled with plain, ansi, html/css etc + utils)
+* [miniwrite](https://github.com/Bartvds/miniwrite) (bundled with streaming console.log, line buffer, node-streams etc + utils)
+
+## Known dependants
+
+* [grunt-tv4](https://github.com/Bartvds/grunt-tv4) (bulk validator with http lookup for grunt)
+* ~~[chai-json-schema](https://github.com/Bartvds/chai-json-schema) (assertion wrappers)~~ (update in progress)
+* (planned) a commandline validator (cued for extraction from `grunt-tv4`)
+* (planned) a json-schema assert()-ion (chai-json-schema without chai)
+
+## Future
+
+1. Output will likely be tuned over time.
+1. Current version is very functional but doesn't yet do anything specific for each validation rule type.
+
+## History
+
+* <= 0.0.4 - Many fixes and tweaks.
+* 0.0.1 - Extracted formatting code from [grunt-tv4](https://github.com/Bartvds/grunt-tv4) and [chai-json-schema](https://github.com/Bartvds/chai-json-schema).
+
+## Build
+
+Nothing much here as the code is still being extracted from the original projects.
+
+~~Install development dependencies in your git checkout:~~
+
+    $ npm install
+
+~~Build and run tests:~~
+
+    $ grunt
+
+See the `Gruntfile.js` for additional commands.
+
+## Contributing
+
+In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
+
+*Note:* this is an opinionated module: please create a [ticket](https://github.com/Bartvds/tv4-reporter/issues) to discuss any big ideas. Pull requests for bug fixes are of course always welcome. 
+
+## License
+
+Copyright (c) 2013 Bart van der Schoor
+
+Licensed under the MIT license.
+
+
+[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Bartvds/tv4-reporter/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
+
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/lib/reporter.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/lib/reporter.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/lib/reporter.js	(revision 487)
@@ -0,0 +1,308 @@
+/*jshint -W098*/
+/*jshint -W003*/
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+var jsonpointer = require('jsonpointer.js');
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+var strimLimit = 100;
+
+// utils
+function pluralise(str, num) {
+	if (num === 1) {
+		return String(str);
+	}
+	return str + 's';
+}
+
+function valueType(value) {
+	var t = typeof value;
+	if (t === 'object' && Object.prototype.toString.call(value) === '[object Array]') {
+		return 'array';
+	}
+	return t;
+}
+
+function valueStrim(value, limit) {
+	limit = (typeof limit !== 'undefined' ? limit : strimLimit);
+
+	var t = valueType(value);
+	if (t === 'function') {
+		return '[function]';
+	}
+	if (t === 'object' || t === 'array') {
+		//return Object.prototype.toString.call(value);
+		value = JSON.stringify(value);
+		if (value.length > limit) {
+			value = value.substr(0, limit - 3) + '...';
+		}
+		return value;
+	}
+	if (t === 'string') {
+		if (value.length > limit) {
+			return JSON.stringify(value.substr(0, limit - 4)) + '"...';
+		}
+		return JSON.stringify(value);
+	}
+	return String(value);
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+function createTest(schema, value, label, result, failOnMissing) {
+	var test = {
+		schema: schema,
+		value: value,
+		label: label,
+		result: result,
+		failOnMissing: !!failOnMissing
+	};
+	return test;
+}
+
+var props = [
+	'schema',
+	'value',
+	'label',
+	'result'
+];
+
+function checkTest(target) {
+	var missing = [];
+	for (var i = 0; i < props.length; i++) {
+		if (typeof target[props[i]] === 'undefined') {
+			missing.push(props[i]);
+		}
+	}
+	return missing;
+}
+
+function isTest(target) {
+	return (checkTest(target).length === 0);
+}
+
+function assertTest(target) {
+	var missing = checkTest(target);
+	if (missing.length > 0) {
+		throw new Error('target is missing required properties: ' + missing.join());
+	}
+}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+function getReporter(out, style) {
+
+	var repAccent = style.accent('/');
+	var repProto = style.accent('://');
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function tweakURI(str) {
+		return str.split(/:\/\//).map(function (str) {
+			return str.replace(/\//g, repAccent);
+		}).join(repProto);
+	}
+
+	function tweakMessage(str) {
+		return style.warning(str.charAt(0).toLowerCase() + str.substr(1));
+	}
+
+	function tweakPath(str) {
+		return str.replace(/\//g, style.accent('/'));
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	// best-effort
+	function extractSchemaLabel(schema, limit) {
+		limit = typeof limit === 'undefined' ? strimLimit : limit;
+		var label = '';
+		if (schema.id) {
+			label = style.accent(schema.id);
+		}
+		if (schema.title) {
+			label += style.accent(label ? ' (' + schema.title + ')' : style.accent(schema.title));
+		}
+
+		if (!label) {
+			if (schema.description) {
+				label = style.accent('<no id>') + ' ' + valueStrim(schema.description, limit);
+			}
+			else {
+				label = style.accent('<no id>') + ' ' + valueStrim(schema, limit);
+			}
+		}
+		return label;
+	}
+
+	// best-effort
+	function extractCTXLabel(test, limit) {
+		limit = typeof limit === 'undefined' ? strimLimit : limit;
+		var label;
+		if (test.label) {
+			label = style.accent(test.label);
+		}
+		if (!label) {
+			label = style.accent('<no label>') + ' ' + valueStrim(test.value, limit);
+		}
+		return label;
+	}
+
+	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+	function reportResult(test, indent) {
+		assertTest(test);
+
+		if (test.result.valid) {
+			if (test.failOnMissing && test.result.missing && test.result.missing.length > 0) {
+				reportFailed(test, indent);
+			}
+			else {
+				reportSuccess(test);
+			}
+		}
+		else {
+			reportFailed(test, indent);
+		}
+		reportMissing(test, indent);
+	}
+
+	function reportSuccess(test) {
+		out.writeln(style.success('>> ') + 'success ' + extractCTXLabel(test));
+		out.writeln(style.success('>> ') + extractSchemaLabel(test.schema));
+	}
+
+	function reportFailed(test, indent) {
+		out.writeln(style.error('>> ') + 'failed ' + style.error(test.label));
+		out.writeln(style.error('!= ') + extractSchemaLabel(test.schema));
+
+		if (test.result.errors) {
+			test.result.errors.forEach(function (err) {
+				reportError(test, err, indent, indent);
+			});
+		}
+		else if (test.result.error) {
+			reportError(test, test.result.error, indent, indent);
+		}
+	}
+
+	function reportMissing(test, indent) {
+		if (test.result.missing && test.result.missing.length > 0) {
+			out.writeln('   ' + style.warning('missing ' + pluralise('schema', test.result.missing.length) + ':') + ' ');
+			test.result.missing.forEach(function (missing) {
+				out.writeln(indent + style.error(' - ') + valueStrim(missing));
+			});
+		}
+	}
+
+	function reportError(test, error, indent, prefix, parentPath) {
+		assertTest(test);
+
+		var value = test.value;
+		if (typeof test.value === 'object') {
+			value = jsonpointer.get(test.value, error.dataPath);
+		}
+		var schemaValue = jsonpointer.get(test.schema, error.schemaPath);
+
+		indent = (typeof indent !== 'undefined' ? String(indent) : '   ');
+		prefix = (typeof prefix !== 'undefined' ? prefix : '');
+
+		if (error.message) {
+			out.writeln(prefix + tweakMessage(error.message));
+		}
+		else {
+			out.writeln(prefix + style.error('<no message>'));
+		}
+
+		if (typeof schemaValue !== 'undefined') {
+			out.writeln(prefix + indent + valueStrim(schemaValue) + style.accent(' -> ') + tweakPath(error.schemaPath));
+		}
+		else {
+			out.writeln(prefix + indent + tweakPath(error.schemaPath));
+		}
+
+		if ((typeof parentPath !== 'string' || parentPath !== error.dataPath)) {
+			if (error.dataPath !== '') {
+				out.writeln(prefix + indent + style.error(' > ') + tweakPath(error.dataPath));
+			}
+			else {
+				//out.writeln(prefix + indent + out.error(' > ') + '<root>');
+			}
+			if (typeof value === 'undefined') {
+				out.writeln(prefix + indent + style.error(' > ') + valueType(value));
+			}
+			else {
+				out.writeln(prefix + indent + style.error(' > ') + valueType(value) + style.error(' -> ') + valueStrim(value));
+			}
+		}
+
+		if (error.subErrors) {
+			error.subErrors.forEach(function (sub) {
+				// let's go deeper
+				reportError(test, sub, indent, prefix + indent, error.dataPath);
+			});
+		}
+	}
+
+	function reportTotals(numFailed, numPassed) {
+		var total = numFailed + numPassed;
+		if (numFailed > 0) {
+			out.writeln(style.error('>> ') + 'tv4 ' + (numPassed > 0 ? style.warning('validated ' + numPassed) + ', ' : '') + style.error('failed ' + numFailed) + ' of ' + style.error(total + ' ' + pluralise('value', total)));
+		}
+		else if (total === 0) {
+			//out.writeln('');
+			out.writeln(style.warning('>> ') + 'tv4 ' + style.warning('validated zero values'));
+		}
+		else {
+			//out.writeln('');
+			out.writeln(style.success('>> ') + 'tv4 ' + style.success('validated ' + numPassed) + ' of ' + style.success(total + ' ' + pluralise('value', total)));
+		}
+	}
+
+	function reportBulk(failed, passed, indent) {
+		if (!passed) {
+			passed = [];
+		}
+		indent = (typeof indent !== 'undefined' ? String(indent) : '   ');
+
+		var total = failed.length + passed.length;
+
+		//got some failures: print log and fail the task
+		if (failed.length > 0) {
+			failed.forEach(function (test, i) {
+				assertTest(test);
+
+				reportFailed(test, indent);
+
+				if (i < failed.length - 1) {
+					out.writeln('');
+				}
+			});
+			out.writeln('');
+		}
+		reportTotals(failed.length, passed.length);
+	}
+
+	return {
+		createTest: createTest,
+		checkTest: checkTest,
+		isTest: isTest,
+		assertTest: assertTest,
+
+		extractSchemaLabel: extractSchemaLabel,
+		extractCTXLabel: extractCTXLabel,
+
+		reportResult: reportResult,
+		reportSuccess: reportSuccess,
+		reportFailed: reportFailed,
+		reportError: reportError,
+		reportMissing: reportMissing,
+		reportBulk: reportBulk
+	};
+}
+
+module.exports = {
+	getReporter: getReporter
+};
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4-reporter/package.json	(revision 487)
@@ -0,0 +1,61 @@
+{
+  "name": "tv4-reporter",
+  "description": "Report Tiny Validator tv4 results in usable formats",
+  "version": "0.0.4",
+  "homepage": "https://github.com/Bartvds/tv4-reporter",
+  "author": {
+    "name": "Bart van der Schoor",
+    "url": "https://github.com/Bartvds"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/Bartvds/tv4-reporter"
+  },
+  "bugs": {
+    "url": "https://github.com/Bartvds/tv4-reporter/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/Bartvds/tv4-reporter/blob/master/LICENSE-MIT"
+    }
+  ],
+  "keywords": [
+    "tv4",
+    "format",
+    "reporter",
+    "json-schema"
+  ],
+  "main": "lib/reporter.js",
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "dependencies": {
+    "ministyle": "~0.1.0",
+    "miniwrite": "~0.1.0",
+    "jsonpointer.js": "0.3.0"
+  },
+  "devDependencies": {
+    "tv4": "~1.0.11",
+    "grunt-cli": "~0.1",
+    "grunt": "~0.4.1",
+    "grunt-contrib-jshint": "~0.7.2",
+    "jshint-path-reporter": "~0.1.3"
+  },
+  "perDependencies": {
+    "tv4": "~1.0.11",
+    "ministyle": "~0.1.0",
+    "miniwrite": "~0.1.0"
+  },
+  "readme": "# tv4-reporter\r\n\r\n[![Build Status](https://secure.travis-ci.org/Bartvds/tv4-reporter.png?branch=master)](http://travis-ci.org/Bartvds/tv4-reporter) [![Dependency Status](https://gemnasium.com/Bartvds/tv4-reporter.png)](https://gemnasium.com/Bartvds/tv4-reporter) [![NPM version](https://badge.fury.io/js/tv4-reporter.png)](http://badge.fury.io/js/tv4-reporter)\r\n\r\n> Reporters to display usable [Tiny Validator tv4](https://github.com/geraintluff/tv4) output of [json-schema](http://jsonschema.org) validation.\r\n \r\nThis module is used by various dependants to render `tv4` validation result objects in a compact but highly readable (and possibly colourful) format. Functionality is tuned for both CLI output as well as plain-text or pre-formatted HTML/CSS. \r\n\r\n**Note:** at this point this is *not* a 'validator' or 'test runner', nor is it a finished application. It is a library to use as dependency in `tv4` based testers. Use plain `tv4` and pass the result(s) to one of `tv4-reporters` helpers. If you are looking for a validator see one of the implementing tv4 wrappers for convenience (some linked below). \r\n\r\n## Features\r\n\r\n* Indented, tree-like display.\r\n* Single and multiple errors.\r\n* Optionally display summaries.\r\n* Recursive sub-errors (as generated by `anyOf`, `oneOf` etc).\r\n* Missing sub-schemas (optionally report as fail or pass reason).\r\n* Various output writer/coloriser modes using [ministyle](https://github.com/Bartvds/ministyle) and [miniwrite](https://github.com/Bartvds/miniwrite).\r\n\r\n## Examples\r\n\r\n(possibly outdated)\r\n\r\n1. Examples of many different kind of errors in [this Travis-Ci build](https://travis-ci.org/Bartvds/grunt-tv4/jobs/14469941).\r\n1. Bulk reporter with single error:\r\n \r\n  [![WebStorm example](https://raw.github.com/Bartvds/tv4-reporter/master/media/webstorm-example-01.png)](https://raw.github.com/Bartvds/tv4-reporter/master/media/webstorm-example-01.png)\r\n\r\n## Installation\r\n\r\n```shell\r\n$ npm install tv4-reporter --save-dev\r\n```\r\n\r\n## Usage\r\n\r\nStill very-much in flux so possibly outdated examples. \r\n\r\nMinimal use case (likely this is spread over the implementing application):\r\n````js\r\n// assemble the components\r\nvar tv4 = require('tv4');\r\nvar out = require('miniwrite').console();\r\nvar style = require('ministyle').ansi();\r\nvar reporter = require('tv4-reporter').getReporter(out, style);\r\n\r\n// now validate\r\nvar result = tv4.validateMultiple(myValue, mySchema);\r\nif (!result.valid || result.missing.length > 0) {\r\n\t// get data object (might get these in bulk/async from somewhere)\r\n\tvar res = reporter.createTest(mySchema, myValue, 'my special test', true);\r\n\t\r\n\t// report error\r\n\treporter.reportResult(res);\r\n\r\n\t// if you have a many results you can use bulk to print nicely with summaries\r\n\treporter.reportBulk([res, res2, res3], [pass1, pass2]);\r\n\t\r\n\t// only totals\r\n\treporter.reportTotals(3, 4);\r\n}\r\n````\r\n\r\nBulk reporting:\r\n````js\r\n// if you have a many results you can use bulk to print nicely with summaries\r\nreporter.reportBulk([res, res2, res3], [pass1, pass2]);\r\n\r\n// only totals\r\nreporter.reportTotals(3, 4);\r\n````\r\n\r\nFor more API surface like (partial) reporter and various helpers see the exports in the main module. Also see the 'known dependants' for more examples.\r\n\r\n## Output\r\n\r\nReport output and styling done via extensible mini-api's:\r\n \r\n* [ministyle](https://github.com/Bartvds/ministyle) (bundled with plain, ansi, html/css etc + utils)\r\n* [miniwrite](https://github.com/Bartvds/miniwrite) (bundled with streaming console.log, line buffer, node-streams etc + utils)\r\n\r\n## Known dependants\r\n\r\n* [grunt-tv4](https://github.com/Bartvds/grunt-tv4) (bulk validator with http lookup for grunt)\r\n* ~~[chai-json-schema](https://github.com/Bartvds/chai-json-schema) (assertion wrappers)~~ (update in progress)\r\n* (planned) a commandline validator (cued for extraction from `grunt-tv4`)\r\n* (planned) a json-schema assert()-ion (chai-json-schema without chai)\r\n\r\n## Future\r\n\r\n1. Output will likely be tuned over time.\r\n1. Current version is very functional but doesn't yet do anything specific for each validation rule type.\r\n\r\n## History\r\n\r\n* <= 0.0.4 - Many fixes and tweaks.\r\n* 0.0.1 - Extracted formatting code from [grunt-tv4](https://github.com/Bartvds/grunt-tv4) and [chai-json-schema](https://github.com/Bartvds/chai-json-schema).\r\n\r\n## Build\r\n\r\nNothing much here as the code is still being extracted from the original projects.\r\n\r\n~~Install development dependencies in your git checkout:~~\r\n\r\n    $ npm install\r\n\r\n~~Build and run tests:~~\r\n\r\n    $ grunt\r\n\r\nSee the `Gruntfile.js` for additional commands.\r\n\r\n## Contributing\r\n\r\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\r\n\r\n*Note:* this is an opinionated module: please create a [ticket](https://github.com/Bartvds/tv4-reporter/issues) to discuss any big ideas. Pull requests for bug fixes are of course always welcome. \r\n\r\n## License\r\n\r\nCopyright (c) 2013 Bart van der Schoor\r\n\r\nLicensed under the MIT license.\r\n\r\n\r\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Bartvds/tv4-reporter/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\r\n\r\n",
+  "readmeFilename": "README.md",
+  "_id": "tv4-reporter@0.0.4",
+  "dist": {
+    "shasum": "6f2f38a6a797c899e1a76f629346325de377fa19"
+  },
+  "_from": "tv4-reporter@~0.0.3",
+  "_resolved": "https://registry.npmjs.org/tv4-reporter/-/tv4-reporter-0.0.4.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/LICENSE.txt
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/LICENSE.txt	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/LICENSE.txt	(revision 487)
@@ -0,0 +1,8 @@
+/*
+Author: Geraint Luff and others
+Year: 2013
+
+This code is released into the "public domain" by its author(s).  Anybody may use, alter and distribute the code without restriction.  The author makes no guarantees, and takes no liability of any kind for use of this code.
+
+If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.
+*/
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/README.md
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/README.md	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/README.md	(revision 487)
@@ -0,0 +1,402 @@
+# Tiny Validator (for v4 JSON Schema)
+
+[![Build Status](https://secure.travis-ci.org/geraintluff/tv4.png?branch=master)](http://travis-ci.org/geraintluff/tv4) [![Dependency Status](https://gemnasium.com/geraintluff/tv4.png)](https://gemnasium.com/geraintluff/tv4) [![NPM version](https://badge.fury.io/js/tv4.png)](http://badge.fury.io/js/tv4)
+
+Use [json-schema](http://json-schema.org/) [draft v4](http://json-schema.org/latest/json-schema-core.html) to validate simple values and complex objects using a rich [validation vocabulary](http://json-schema.org/latest/json-schema-validation.html) ([examples](http://json-schema.org/examples.html)).
+
+There is support for `$ref` with JSON Pointer fragment paths (```other-schema.json#/properties/myKey```).
+
+## Usage 1: Simple validation
+
+```javascript
+var valid = tv4.validate(data, schema);
+```
+
+If validation returns ```false```, then an explanation of why validation failed can be found in ```tv4.error```.
+
+The error object will look something like:
+```json
+{
+    "code": 0,
+    "message": "Invalid type: string",
+    "dataPath": "/intKey",
+    "schemaKey": "/properties/intKey/type"
+}
+```
+
+The `"code"` property will refer to one of the values in `tv4.errorCodes` - in this case, `tv4.errorCodes.INVALID_TYPE`.
+
+To enable external schema to be referenced, you use:
+```javascript
+tv4.addSchema(url, schema);
+```
+
+If schemas are referenced (```$ref```) but not known, then validation will return ```true``` and the missing schema(s) will be listed in ```tv4.missing```. For more info see the API documentation below.
+
+## Usage 2: Multi-threaded validation
+
+Storing the error and missing schemas does not work well in multi-threaded environments, so there is an alternative syntax:
+
+```javascript
+var result = tv4.validateResult(data, schema);
+```
+
+The result will look something like:
+```json
+{
+    "valid": false,
+    "error": {...},
+    "missing": [...]
+}
+```
+
+## Usage 3: Multiple errors
+
+Normally, `tv4` stops when it encounters the first validation error.  However, you can collect an array of validation errors using:
+
+```javascript
+var result = tv4.validateMultiple(data, schema);
+```
+
+The result will look something like:
+```json
+{
+    "valid": false,
+    "errors": [
+        {...},
+        ...
+    ],
+    "missing": [...]
+}
+```
+
+## Asynchronous validation
+
+Support for asynchronous validation (where missing schemas are fetched) can be added by including an extra JavaScript file.  Currently, the only version requires jQuery (`tv4.async-jquery.js`), but the code is very short and should be fairly easy to modify for other libraries (such as MooTools).
+
+Usage:
+
+```javascript
+tv4.validate(data, schema, function (isValid, validationError) { ... });
+```
+
+`validationFailure` is simply taken from `tv4.error`.
+
+## Cyclical JavaScript objects
+
+While they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional third argument: `checkRecursive`. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script.
+
+Consider this data, notice how both `a` and `b` refer to each other:
+
+```javascript
+var a = {};
+var b = { a: a };
+a.b = b;
+var aSchema = { properties: { b: { $ref: 'bSchema' }}};
+var bSchema = { properties: { a: { $ref: 'aSchema' }}};
+tv4.addSchema('aSchema', aSchema);
+tv4.addSchema('bSchema', bSchema);
+```
+
+If the `checkRecursive` argument were missing, this would throw a "too much recursion" error. 
+
+To enable support for this, pass `true` as additional argument to any of the regular validation methods: 
+
+```javascript
+tv4.validate(a, aSchema, true);
+tv4.validateResult(data, aSchema, true); 
+tv4.validateMultiple(data, aSchema, true);
+```
+
+## The `banUnknownProperties` flag
+
+Sometimes, it is desirable to flag all unknown properties as an error.  This is especially useful during development, to catch typos and the like, even when extra custom-defined properties are allowed.
+
+As such, tv4 implements ["ban unknown properties" mode](https://github.com/json-schema/json-schema/wiki/ban-unknown-properties-mode-\(v5-proposal\)), enabled by a fourth-argument flag:
+
+```javascript
+tv4.validate(data, schema, checkRecursive, true);
+tv4.validateResult(data, schema, checkRecursive, true);
+tv4.validateMultiple(data, schema, checkRecursive, true);
+```
+
+## API
+
+There are additional api commands available for more complex use-cases:
+
+##### addSchema(uri, schema)
+Pre-register a schema for reference by other schema and synchronous validation.
+
+````js
+tv4.addSchema('http://example.com/schema', { ... });
+````
+
+* `uri` the uri to identify this schema.
+* `schema` the schema object.
+
+Schemas that have their `id` property set can be added directly.
+
+````js
+tv4.addSchema({ ... });
+````
+
+##### getSchema(uri)
+
+Return a schema from the cache.
+
+* `uri` the uri of the schema (may contain a `#` fragment)
+
+````js
+var schema = tv4.getSchema('http://example.com/schema');
+````
+
+##### getSchemaMap()
+
+Return a shallow copy of the schema cache, mapping schema document URIs to schema objects.
+
+````
+var map = tv4.getSchemaMap();
+
+var schema = map[uri];
+````
+
+##### getSchemaUris(filter)
+
+Return an Array with known schema document URIs.
+
+* `filter` optional RegExp to filter URIs
+
+````
+var arr = tv4.getSchemaUris();
+
+// optional filter using a RegExp
+var arr = tv4.getSchemaUris(/^https?://example.com/);
+````
+
+##### getMissingUris(filter)
+
+Return an Array with schema document URIs that are used as `$ref` in known schemas but which currently have no associated schema data.
+
+Use this in combination with `tv4.addSchema(uri, schema)` to preload the cache for complete synchronous validation with.
+
+* `filter` optional RegExp to filter URIs
+
+````
+var arr = tv4.getMissingUris();
+
+// optional filter using a RegExp
+var arr = tv4.getMissingUris(/^https?://example.com/);
+````
+
+##### dropSchemas()
+
+Drop all known schema document URIs from the cache.
+
+````
+tv4.dropSchemas();
+````
+
+##### freshApi()
+
+Return a new tv4 instance with no shared state.
+
+````
+var otherTV4 = tv4.freshApi();
+````
+
+##### reset()
+
+Manually reset validation status from the simple `tv4.validate(data, schema)`. Although tv4 will self reset on each validation there are some implementation scenarios where this is useful.
+
+````
+tv4.reset();
+````
+
+##### language(code)
+
+Select the language map used for reporting.
+
+* `code` is a language code, like `'en'` or `'en-gb'`
+
+````
+tv4.language('en-gb');
+````
+
+##### addLanguage(code, map)
+
+Add a new language map for selection by `tv4.language(code)`
+
+* `code` is new language code
+* `map` is an object mapping error IDs or constant names (e.g. `103` or `"NUMBER_MAXIMUM"`) to language strings.
+
+````
+tv4.addLanguage('fr', { ... });
+
+// select for use
+tv4.language('fr')
+````
+
+##### addFormat(format, validationFunction)
+
+Add a custom format validator. (There are no built-in format validators.)
+
+* `format` is a string, corresponding to the `"format"` value in schemas.
+* `validationFunction` is a function that either returns:
+  * `null` (meaning no error)
+  * an error string (explaining the reason for failure)
+
+````
+tv4.addFormat('decimal-digits', function (data, schema) {
+	if (typeof data === 'string' && !/^[0-9]+$/.test(data)) {
+		return null;
+	}
+	return "must be string of decimal digits";
+});
+````
+
+Alternatively, multiple formats can be added at the same time using an object:
+````
+tv4.addFormat({
+	'my-format': function () {...},
+	'other-format': function () {...}
+});
+````
+
+## Demos
+
+### Basic usage
+<div class="content inline-demo" markdown="1" data-demo="demo1">
+<pre class="code" id="demo1">
+var schema = {
+	"items": {
+		"type": "boolean"
+	}
+};
+var data1 = [true, false];
+var data2 = [true, 123];
+
+alert("data 1: " + tv4.validate(data1, schema)); // true
+alert("data 2: " + tv4.validate(data2, schema)); // false
+alert("data 2 error: " + JSON.stringify(tv4.error, null, 4));
+</pre>
+</div>
+
+### Use of <code>$ref</code>
+<div class="content inline-demo" markdown="1" data-demo="demo2">
+<pre class="code" id="demo2">
+var schema = {
+	"type": "array",
+	"items": {"$ref": "#"}
+};
+var data1 = [[], [[]]];
+var data2 = [[], [true, []]];
+
+alert("data 1: " + tv4.validate(data1, schema)); // true
+alert("data 2: " + tv4.validate(data2, schema)); // false
+</pre>
+</div>
+
+### Missing schema
+<div class="content inline-demo" markdown="1" data-demo="demo3">
+<pre class="code" id="demo3">
+var schema = {
+	"type": "array",
+	"items": {"$ref": "http://example.com/schema" }
+};
+var data = [1, 2, 3];
+
+alert("Valid: " + tv4.validate(data, schema)); // true
+alert("Missing schemas: " + JSON.stringify(tv4.missing));
+</pre>
+</div>
+
+### Referencing remote schema
+<div class="content inline-demo" markdown="1" data-demo="demo4">
+<pre class="code" id="demo4">
+tv4.addSchema("http://example.com/schema", {
+	"definitions": {
+		"arrayItem": {"type": "boolean"}
+	}
+});
+var schema = {
+	"type": "array",
+	"items": {"$ref": "http://example.com/schema#/definitions/arrayItem" }
+};
+var data1 = [true, false, true];
+var data2 = [1, 2, 3];
+
+alert("data 1: " + tv4.validate(data1, schema)); // true
+alert("data 2: " + tv4.validate(data2, schema)); // false
+</pre>
+</div>
+
+## Supported platforms
+
+* Node.js
+* All modern browsers
+* IE >= 7
+
+## Installation
+
+You can manually download [`tv4.js`](https://raw.github.com/geraintluff/tv4/master/tv4.js) or the minified [`tv4.min.js`](https://raw.github.com/geraintluff/tv4/master/tv4.min.js) and include it in your html to create the global `tv4` variable.
+
+Alternately use it as a CommonJS module:
+
+````js
+var tv4 = require('tv4');
+````
+
+#### npm
+
+````
+$ npm install tv4
+````
+
+#### bower
+
+````
+$ bower install tv4
+````
+
+#### component.io
+
+````
+$ component install geraintluff/tv4
+````
+
+## Build and test
+
+You can rebuild and run the node and browser tests using node.js and [grunt](http://http://gruntjs.com/):
+
+Make sure you have the global grunt cli command:
+````
+$ npm install grunt-cli -g
+````
+
+Clone the git repos, open a shell in the root folder and install the development dependencies:
+
+````
+$ npm install
+````
+
+Rebuild and run the tests:
+````
+$ grunt
+````
+
+It will run a build and display one Spec-style report for the node.js and two Dot-style reports for both the plain and minified browser tests (via phantomJS). You can also use your own browser to manually run the suites by opening [`test/index.html`](http://geraintluff.github.io/tv4/test/index.html) and [`test/index-min.html`](http://geraintluff.github.io/tv4/test/index-min.html).
+
+## Contributing
+
+Pull-requests for fixes and expansions are welcome. Edit the partial files in `/source` and add your tests in a suitable suite or folder under `/test/tests` and run `grunt` to rebuild and run the test suite. Try to maintain an idiomatic coding style and add tests for any new features. It is recommend to discuss big changes in an Issue.
+
+## Packages using tv4
+
+* [chai-json-schema](http://chaijs.com/plugins/chai-json-schema) is a [Chai Assertion Library](http://chaijs.com) plugin to assert values against json-schema.
+* [grunt-tv4](http://www.github.com/Bartvds/grunt-tv4) is a plugin for [Grunt](http://http://gruntjs.com/) that uses tv4 to bulk validate json files.
+
+## License
+
+The code is available as "public domain", meaning that it is completely free to use, without any restrictions at all.  Read the full license [here](http://geraintluff.github.com/tv4/LICENSE.txt).
+
+It's also available under an [MIT license](http://jsonary.com/LICENSE.txt).
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/lang/de.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/lang/de.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/lang/de.js	(revision 487)
@@ -0,0 +1,29 @@
+tv4.addLanguage('de',  {
+    INVALID_TYPE: "UngÃŒltiger Typ: {type} (erwartet wurde: {expected})",
+    ENUM_MISMATCH: "Keine Ãbereinstimmung mit der AufzÃ€hlung (enum) fÃŒr: {value}",
+    ANY_OF_MISSING: "Daten stimmen nicht ÃŒberein mit einem der Schemas von \"anyOf\"",
+    ONE_OF_MISSING: "Daten stimmen nicht ÃŒberein mit einem der Schemas von \"oneOf\"",
+    ONE_OF_MULTIPLE: "Daten sind valid in Bezug auf mehreren Schemas von \"oneOf\": index {index1} und {index2}",
+    NOT_PASSED: "Daten stimmen mit dem \"not\" Schema ÃŒberein",
+    // Numeric errors
+    NUMBER_MULTIPLE_OF: "Wert {value} ist kein Vielfaches von {multipleOf}",
+    NUMBER_MINIMUM: "Wert {value} ist kleiner als das Minimum {minimum}",
+    NUMBER_MINIMUM_EXCLUSIVE: "Wert {value} ist gleich dem Exklusiven Minimum {minimum}",
+    NUMBER_MAXIMUM: "Wert {value} ist grÃ¶Ãer als das Maximum {maximum}",
+    NUMBER_MAXIMUM_EXCLUSIVE: "Wert {value} ist gleich dem Exklusiven Maximum {maximum}",
+    // String errors
+    STRING_LENGTH_SHORT: "Zeichenkette zu kurz ({length} chars), minimum {minimum}",
+    STRING_LENGTH_LONG: "Zeichenkette zu lang ({length} chars), maximum {maximum}",
+    STRING_PATTERN: "Zeichenkette entspricht nicht dem Muster: {pattern}",
+    // Object errors
+    OBJECT_PROPERTIES_MINIMUM: "Zu wenige Attribute definiert ({propertyCount}), minimum {minimum}",
+    OBJECT_PROPERTIES_MAXIMUM: "Zu viele Attribute definiert ({propertyCount}), maximum {maximum}",
+    OBJECT_REQUIRED: "Notwendiges Attribut fehlt: {key}",
+    OBJECT_ADDITIONAL_PROPERTIES: "ZusÃ€tzliche Attribute nicht erlaubt",
+    OBJECT_DEPENDENCY_KEY: "AbhÃ€ngigkeit fehlt - SchlÃŒssel nicht vorhanden: {missing} (wegen SchlÃŒssel: {key})",
+    // Array errors
+    ARRAY_LENGTH_SHORT: "Array zu kurz ({length}), minimum {minimum}",
+    ARRAY_LENGTH_LONG: "Array zu lang ({length}), maximum {maximum}",
+    ARRAY_UNIQUE: "Array EintrÃ€ge nicht eindeutig (Index {match1} und {match2})",
+    ARRAY_ADDITIONAL_ITEMS: "ZusÃ€tzliche EintrÃ€ge nicht erlaubt"
+});
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/package.json	(revision 487)
@@ -0,0 +1,71 @@
+{
+  "name": "tv4",
+  "version": "1.0.16",
+  "author": {
+    "name": "Geraint Luff"
+  },
+  "description": "A public domain JSON Schema validator for JavaScript",
+  "keywords": [
+    "json-schema",
+    "schema",
+    "validator",
+    "tv4"
+  ],
+  "maintainers": [
+    {
+      "name": "Geraint Luff",
+      "email": "luffgd@gmail.com",
+      "url": "https://github.com/geraintluff/"
+    }
+  ],
+  "main": "tv4.js",
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/geraintluff/tv4.git"
+  },
+  "license:": [
+    {
+      "type": "Public Domain",
+      "url": "http://geraintluff.github.io/tv4/LICENSE.txt"
+    },
+    {
+      "type": "MIT",
+      "url": "http://jsonary.com/LICENSE.txt"
+    }
+  ],
+  "devDependencies": {
+    "grunt": "~0.4.1",
+    "grunt-contrib-clean": "~0.4.1",
+    "grunt-contrib-jshint": "~0.6.2",
+    "mocha": "~1.11.0",
+    "grunt-mocha": "~0.4",
+    "grunt-mocha-test": "~0.5.0",
+    "grunt-cli": "~0.1.9",
+    "grunt-contrib-uglify": "~0.2.2",
+    "grunt-contrib-copy": "~0.4.1",
+    "proclaim": "1.4",
+    "mocha-unfunk-reporter": "~0.2",
+    "jshint-path-reporter": "~0.1",
+    "grunt-concat-sourcemap": "~0.2",
+    "source-map-support": "~0.1",
+    "grunt-markdown": "~0.3.0",
+    "grunt-component": "~0.1.4",
+    "grunt-push-release": "~0.1.1",
+    "grunt-regex-replace": "~0.2.5"
+  },
+  "engines": {
+    "node": ">= 0.8.0"
+  },
+  "scripts": {
+    "test": "grunt test",
+    "prepublish": "grunt prepublish"
+  },
+  "readme": "# Tiny Validator (for v4 JSON Schema)\n\n[![Build Status](https://secure.travis-ci.org/geraintluff/tv4.png?branch=master)](http://travis-ci.org/geraintluff/tv4) [![Dependency Status](https://gemnasium.com/geraintluff/tv4.png)](https://gemnasium.com/geraintluff/tv4) [![NPM version](https://badge.fury.io/js/tv4.png)](http://badge.fury.io/js/tv4)\n\nUse [json-schema](http://json-schema.org/) [draft v4](http://json-schema.org/latest/json-schema-core.html) to validate simple values and complex objects using a rich [validation vocabulary](http://json-schema.org/latest/json-schema-validation.html) ([examples](http://json-schema.org/examples.html)).\n\nThere is support for `$ref` with JSON Pointer fragment paths (```other-schema.json#/properties/myKey```).\n\n## Usage 1: Simple validation\n\n```javascript\nvar valid = tv4.validate(data, schema);\n```\n\nIf validation returns ```false```, then an explanation of why validation failed can be found in ```tv4.error```.\n\nThe error object will look something like:\n```json\n{\n    \"code\": 0,\n    \"message\": \"Invalid type: string\",\n    \"dataPath\": \"/intKey\",\n    \"schemaKey\": \"/properties/intKey/type\"\n}\n```\n\nThe `\"code\"` property will refer to one of the values in `tv4.errorCodes` - in this case, `tv4.errorCodes.INVALID_TYPE`.\n\nTo enable external schema to be referenced, you use:\n```javascript\ntv4.addSchema(url, schema);\n```\n\nIf schemas are referenced (```$ref```) but not known, then validation will return ```true``` and the missing schema(s) will be listed in ```tv4.missing```. For more info see the API documentation below.\n\n## Usage 2: Multi-threaded validation\n\nStoring the error and missing schemas does not work well in multi-threaded environments, so there is an alternative syntax:\n\n```javascript\nvar result = tv4.validateResult(data, schema);\n```\n\nThe result will look something like:\n```json\n{\n    \"valid\": false,\n    \"error\": {...},\n    \"missing\": [...]\n}\n```\n\n## Usage 3: Multiple errors\n\nNormally, `tv4` stops when it encounters the first validation error.  However, you can collect an array of validation errors using:\n\n```javascript\nvar result = tv4.validateMultiple(data, schema);\n```\n\nThe result will look something like:\n```json\n{\n    \"valid\": false,\n    \"errors\": [\n        {...},\n        ...\n    ],\n    \"missing\": [...]\n}\n```\n\n## Asynchronous validation\n\nSupport for asynchronous validation (where missing schemas are fetched) can be added by including an extra JavaScript file.  Currently, the only version requires jQuery (`tv4.async-jquery.js`), but the code is very short and should be fairly easy to modify for other libraries (such as MooTools).\n\nUsage:\n\n```javascript\ntv4.validate(data, schema, function (isValid, validationError) { ... });\n```\n\n`validationFailure` is simply taken from `tv4.error`.\n\n## Cyclical JavaScript objects\n\nWhile they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional third argument: `checkRecursive`. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script.\n\nConsider this data, notice how both `a` and `b` refer to each other:\n\n```javascript\nvar a = {};\nvar b = { a: a };\na.b = b;\nvar aSchema = { properties: { b: { $ref: 'bSchema' }}};\nvar bSchema = { properties: { a: { $ref: 'aSchema' }}};\ntv4.addSchema('aSchema', aSchema);\ntv4.addSchema('bSchema', bSchema);\n```\n\nIf the `checkRecursive` argument were missing, this would throw a \"too much recursion\" error. \n\nTo enable support for this, pass `true` as additional argument to any of the regular validation methods: \n\n```javascript\ntv4.validate(a, aSchema, true);\ntv4.validateResult(data, aSchema, true); \ntv4.validateMultiple(data, aSchema, true);\n```\n\n## The `banUnknownProperties` flag\n\nSometimes, it is desirable to flag all unknown properties as an error.  This is especially useful during development, to catch typos and the like, even when extra custom-defined properties are allowed.\n\nAs such, tv4 implements [\"ban unknown properties\" mode](https://github.com/json-schema/json-schema/wiki/ban-unknown-properties-mode-\\(v5-proposal\\)), enabled by a fourth-argument flag:\n\n```javascript\ntv4.validate(data, schema, checkRecursive, true);\ntv4.validateResult(data, schema, checkRecursive, true);\ntv4.validateMultiple(data, schema, checkRecursive, true);\n```\n\n## API\n\nThere are additional api commands available for more complex use-cases:\n\n##### addSchema(uri, schema)\nPre-register a schema for reference by other schema and synchronous validation.\n\n````js\ntv4.addSchema('http://example.com/schema', { ... });\n````\n\n* `uri` the uri to identify this schema.\n* `schema` the schema object.\n\nSchemas that have their `id` property set can be added directly.\n\n````js\ntv4.addSchema({ ... });\n````\n\n##### getSchema(uri)\n\nReturn a schema from the cache.\n\n* `uri` the uri of the schema (may contain a `#` fragment)\n\n````js\nvar schema = tv4.getSchema('http://example.com/schema');\n````\n\n##### getSchemaMap()\n\nReturn a shallow copy of the schema cache, mapping schema document URIs to schema objects.\n\n````\nvar map = tv4.getSchemaMap();\n\nvar schema = map[uri];\n````\n\n##### getSchemaUris(filter)\n\nReturn an Array with known schema document URIs.\n\n* `filter` optional RegExp to filter URIs\n\n````\nvar arr = tv4.getSchemaUris();\n\n// optional filter using a RegExp\nvar arr = tv4.getSchemaUris(/^https?://example.com/);\n````\n\n##### getMissingUris(filter)\n\nReturn an Array with schema document URIs that are used as `$ref` in known schemas but which currently have no associated schema data.\n\nUse this in combination with `tv4.addSchema(uri, schema)` to preload the cache for complete synchronous validation with.\n\n* `filter` optional RegExp to filter URIs\n\n````\nvar arr = tv4.getMissingUris();\n\n// optional filter using a RegExp\nvar arr = tv4.getMissingUris(/^https?://example.com/);\n````\n\n##### dropSchemas()\n\nDrop all known schema document URIs from the cache.\n\n````\ntv4.dropSchemas();\n````\n\n##### freshApi()\n\nReturn a new tv4 instance with no shared state.\n\n````\nvar otherTV4 = tv4.freshApi();\n````\n\n##### reset()\n\nManually reset validation status from the simple `tv4.validate(data, schema)`. Although tv4 will self reset on each validation there are some implementation scenarios where this is useful.\n\n````\ntv4.reset();\n````\n\n##### language(code)\n\nSelect the language map used for reporting.\n\n* `code` is a language code, like `'en'` or `'en-gb'`\n\n````\ntv4.language('en-gb');\n````\n\n##### addLanguage(code, map)\n\nAdd a new language map for selection by `tv4.language(code)`\n\n* `code` is new language code\n* `map` is an object mapping error IDs or constant names (e.g. `103` or `\"NUMBER_MAXIMUM\"`) to language strings.\n\n````\ntv4.addLanguage('fr', { ... });\n\n// select for use\ntv4.language('fr')\n````\n\n##### addFormat(format, validationFunction)\n\nAdd a custom format validator. (There are no built-in format validators.)\n\n* `format` is a string, corresponding to the `\"format\"` value in schemas.\n* `validationFunction` is a function that either returns:\n  * `null` (meaning no error)\n  * an error string (explaining the reason for failure)\n\n````\ntv4.addFormat('decimal-digits', function (data, schema) {\n\tif (typeof data === 'string' && !/^[0-9]+$/.test(data)) {\n\t\treturn null;\n\t}\n\treturn \"must be string of decimal digits\";\n});\n````\n\nAlternatively, multiple formats can be added at the same time using an object:\n````\ntv4.addFormat({\n\t'my-format': function () {...},\n\t'other-format': function () {...}\n});\n````\n\n## Demos\n\n### Basic usage\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo1\">\n<pre class=\"code\" id=\"demo1\">\nvar schema = {\n\t\"items\": {\n\t\t\"type\": \"boolean\"\n\t}\n};\nvar data1 = [true, false];\nvar data2 = [true, 123];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\nalert(\"data 2 error: \" + JSON.stringify(tv4.error, null, 4));\n</pre>\n</div>\n\n### Use of <code>$ref</code>\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo2\">\n<pre class=\"code\" id=\"demo2\">\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"#\"}\n};\nvar data1 = [[], [[]]];\nvar data2 = [[], [true, []]];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\n</pre>\n</div>\n\n### Missing schema\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo3\">\n<pre class=\"code\" id=\"demo3\">\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"http://example.com/schema\" }\n};\nvar data = [1, 2, 3];\n\nalert(\"Valid: \" + tv4.validate(data, schema)); // true\nalert(\"Missing schemas: \" + JSON.stringify(tv4.missing));\n</pre>\n</div>\n\n### Referencing remote schema\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo4\">\n<pre class=\"code\" id=\"demo4\">\ntv4.addSchema(\"http://example.com/schema\", {\n\t\"definitions\": {\n\t\t\"arrayItem\": {\"type\": \"boolean\"}\n\t}\n});\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"http://example.com/schema#/definitions/arrayItem\" }\n};\nvar data1 = [true, false, true];\nvar data2 = [1, 2, 3];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\n</pre>\n</div>\n\n## Supported platforms\n\n* Node.js\n* All modern browsers\n* IE >= 7\n\n## Installation\n\nYou can manually download [`tv4.js`](https://raw.github.com/geraintluff/tv4/master/tv4.js) or the minified [`tv4.min.js`](https://raw.github.com/geraintluff/tv4/master/tv4.min.js) and include it in your html to create the global `tv4` variable.\n\nAlternately use it as a CommonJS module:\n\n````js\nvar tv4 = require('tv4');\n````\n\n#### npm\n\n````\n$ npm install tv4\n````\n\n#### bower\n\n````\n$ bower install tv4\n````\n\n#### component.io\n\n````\n$ component install geraintluff/tv4\n````\n\n## Build and test\n\nYou can rebuild and run the node and browser tests using node.js and [grunt](http://http://gruntjs.com/):\n\nMake sure you have the global grunt cli command:\n````\n$ npm install grunt-cli -g\n````\n\nClone the git repos, open a shell in the root folder and install the development dependencies:\n\n````\n$ npm install\n````\n\nRebuild and run the tests:\n````\n$ grunt\n````\n\nIt will run a build and display one Spec-style report for the node.js and two Dot-style reports for both the plain and minified browser tests (via phantomJS). You can also use your own browser to manually run the suites by opening [`test/index.html`](http://geraintluff.github.io/tv4/test/index.html) and [`test/index-min.html`](http://geraintluff.github.io/tv4/test/index-min.html).\n\n## Contributing\n\nPull-requests for fixes and expansions are welcome. Edit the partial files in `/source` and add your tests in a suitable suite or folder under `/test/tests` and run `grunt` to rebuild and run the test suite. Try to maintain an idiomatic coding style and add tests for any new features. It is recommend to discuss big changes in an Issue.\n\n## Packages using tv4\n\n* [chai-json-schema](http://chaijs.com/plugins/chai-json-schema) is a [Chai Assertion Library](http://chaijs.com) plugin to assert values against json-schema.\n* [grunt-tv4](http://www.github.com/Bartvds/grunt-tv4) is a plugin for [Grunt](http://http://gruntjs.com/) that uses tv4 to bulk validate json files.\n\n## License\n\nThe code is available as \"public domain\", meaning that it is completely free to use, without any restrictions at all.  Read the full license [here](http://geraintluff.github.com/tv4/LICENSE.txt).\n\nIt's also available under an [MIT license](http://jsonary.com/LICENSE.txt).\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/geraintluff/tv4/issues"
+  },
+  "homepage": "https://github.com/geraintluff/tv4",
+  "_id": "tv4@1.0.16",
+  "_from": "tv4@~1.0.14"
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/tv4.async-jquery.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/tv4.async-jquery.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/tv4.async-jquery.js	(revision 487)
@@ -0,0 +1,34 @@
+// Provides support for asynchronous validation (fetching schemas) using jQuery
+// Callback is optional third argument to tv4.validate() - if not present, synchronous operation
+//     callback(result, error);
+if (typeof (tv4.asyncValidate) === 'undefined') {
+	tv4.syncValidate = tv4.validate;
+	tv4.validate = function (data, schema, callback, checkRecursive, banUnknownProperties) {
+		if (typeof (callback) === 'undefined') {
+			return this.syncValidate(data, schema, checkRecursive, banUnknownProperties);
+		} else {
+			return this.asyncValidate(data, schema, callback, checkRecursive, banUnknownProperties);
+		}
+	};
+	tv4.asyncValidate = function (data, schema, callback, checkRecursive, banUnknownProperties) {
+		var $ = jQuery;
+		var result = tv4.validate(data, schema, checkRecursive, banUnknownProperties);
+		if (!tv4.missing.length) {
+			callback(result, tv4.error);
+		} else {
+			// Make a request for each missing schema
+			var missingSchemas = $.map(tv4.missing, function (schemaUri) {
+				return $.getJSON(schemaUri).success(function (fetchedSchema) {
+					tv4.addSchema(schemaUri, fetchedSchema);
+				}).error(function () {
+					// If there's an error, just use an empty schema
+					tv4.addSchema(schemaUri, {});
+				});
+			});
+			// When all requests done, try again
+			$.when.apply($, missingSchemas).done(function () {
+				var result = tv4.asyncValidate(data, schema, callback, checkRecursive, banUnknownProperties);
+			});
+		}
+	};
+}
Index: Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/tv4.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/tv4.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/node_modules/tv4/tv4.js	(revision 487)
@@ -0,0 +1,1311 @@
+/*
+Author: Geraint Luff and others
+Year: 2013
+
+This code is released into the "public domain" by its author(s).  Anybody may use, alter and distribute the code without restriction.  The author makes no guarantees, and takes no liability of any kind for use of this code.
+
+If you find a bug or make an improvement, it would be courteous to let the author know, but it is not compulsory.
+*/
+(function (global) {
+'use strict';
+
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FObject%2Fkeys
+if (!Object.keys) {
+	Object.keys = (function () {
+		var hasOwnProperty = Object.prototype.hasOwnProperty,
+			hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
+			dontEnums = [
+				'toString',
+				'toLocaleString',
+				'valueOf',
+				'hasOwnProperty',
+				'isPrototypeOf',
+				'propertyIsEnumerable',
+				'constructor'
+			],
+			dontEnumsLength = dontEnums.length;
+
+		return function (obj) {
+			if (typeof obj !== 'object' && typeof obj !== 'function' || obj === null) {
+				throw new TypeError('Object.keys called on non-object');
+			}
+
+			var result = [];
+
+			for (var prop in obj) {
+				if (hasOwnProperty.call(obj, prop)) {
+					result.push(prop);
+				}
+			}
+
+			if (hasDontEnumBug) {
+				for (var i=0; i < dontEnumsLength; i++) {
+					if (hasOwnProperty.call(obj, dontEnums[i])) {
+						result.push(dontEnums[i]);
+					}
+				}
+			}
+			return result;
+		};
+	})();
+}
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create
+if (!Object.create) {
+	Object.create = (function(){
+		function F(){}
+
+		return function(o){
+			if (arguments.length !== 1) {
+				throw new Error('Object.create implementation only accepts one parameter.');
+			}
+			F.prototype = o;
+			return new F();
+		};
+	})();
+}
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FisArray
+if(!Array.isArray) {
+	Array.isArray = function (vArg) {
+		return Object.prototype.toString.call(vArg) === "[object Array]";
+	};
+}
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FindexOf
+if (!Array.prototype.indexOf) {
+	Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
+		if (this === null) {
+			throw new TypeError();
+		}
+		var t = Object(this);
+		var len = t.length >>> 0;
+
+		if (len === 0) {
+			return -1;
+		}
+		var n = 0;
+		if (arguments.length > 1) {
+			n = Number(arguments[1]);
+			if (n !== n) { // shortcut for verifying if it's NaN
+				n = 0;
+			} else if (n !== 0 && n !== Infinity && n !== -Infinity) {
+				n = (n > 0 || -1) * Math.floor(Math.abs(n));
+			}
+		}
+		if (n >= len) {
+			return -1;
+		}
+		var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);
+		for (; k < len; k++) {
+			if (k in t && t[k] === searchElement) {
+				return k;
+			}
+		}
+		return -1;
+	};
+}
+
+// Grungey Object.isFrozen hack
+if (!Object.isFrozen) {
+	Object.isFrozen = function (obj) {
+		var key = "tv4_test_frozen_key";
+		while (obj.hasOwnProperty(key)) {
+			key += Math.random();
+		}
+		try {
+			obj[key] = true;
+			delete obj[key];
+			return false;
+		} catch (e) {
+			return true;
+		}
+	};
+}
+var ValidatorContext = function ValidatorContext(parent, collectMultiple, errorMessages, checkRecursive, trackUnknownProperties) {
+	this.missing = [];
+	this.missingMap = {};
+	this.formatValidators = parent ? Object.create(parent.formatValidators) : {};
+	this.schemas = parent ? Object.create(parent.schemas) : {};
+	this.collectMultiple = collectMultiple;
+	this.errors = [];
+	this.handleError = collectMultiple ? this.collectError : this.returnError;
+	if (checkRecursive) {
+		this.checkRecursive = true;
+		this.scanned = [];
+		this.scannedFrozen = [];
+		this.scannedFrozenSchemas = [];
+		this.scannedFrozenValidationErrors = [];
+		this.validatedSchemasKey = 'tv4_validation_id';
+		this.validationErrorsKey = 'tv4_validation_errors_id';
+	}
+	if (trackUnknownProperties) {
+		this.trackUnknownProperties = true;
+		this.knownPropertyPaths = {};
+		this.unknownPropertyPaths = {};
+	}
+	this.errorMessages = errorMessages;
+};
+ValidatorContext.prototype.createError = function (code, messageParams, dataPath, schemaPath, subErrors) {
+	var messageTemplate = this.errorMessages[code] || ErrorMessagesDefault[code];
+	if (typeof messageTemplate !== 'string') {
+		return new ValidationError(code, "Unknown error code " + code + ": " + JSON.stringify(messageParams), dataPath, schemaPath, subErrors);
+	}
+	// Adapted from Crockford's supplant()
+	var message = messageTemplate.replace(/\{([^{}]*)\}/g, function (whole, varName) {
+		var subValue = messageParams[varName];
+		return typeof subValue === 'string' || typeof subValue === 'number' ? subValue : whole;
+	});
+	return new ValidationError(code, message, dataPath, schemaPath, subErrors);
+};
+ValidatorContext.prototype.returnError = function (error) {
+	return error;
+};
+ValidatorContext.prototype.collectError = function (error) {
+	if (error) {
+		this.errors.push(error);
+	}
+	return null;
+};
+ValidatorContext.prototype.prefixErrors = function (startIndex, dataPath, schemaPath) {
+	for (var i = startIndex; i < this.errors.length; i++) {
+		this.errors[i] = this.errors[i].prefixWith(dataPath, schemaPath);
+	}
+	return this;
+};
+ValidatorContext.prototype.banUnknownProperties = function () {
+	for (var unknownPath in this.unknownPropertyPaths) {
+		var error = this.createError(ErrorCodes.UNKNOWN_PROPERTY, {path: unknownPath}, unknownPath, "");
+		var result = this.handleError(error);
+		if (result) {
+			return result;
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.addFormat = function (format, validator) {
+	if (typeof format === 'object') {
+		for (var key in format) {
+			this.addFormat(key, format[key]);
+		}
+		return this;
+	}
+	this.formatValidators[format] = validator;
+};
+ValidatorContext.prototype.resolveRefs = function (schema, urlHistory) {
+	if (schema['$ref'] !== undefined) {
+		urlHistory = urlHistory || {};
+		if (urlHistory[schema['$ref']]) {
+			return this.createError(ErrorCodes.CIRCULAR_REFERENCE, {urls: Object.keys(urlHistory).join(', ')}, '', '');
+		}
+		urlHistory[schema['$ref']] = true;
+		schema = this.getSchema(schema['$ref'], urlHistory);
+	}
+	return schema;
+};
+ValidatorContext.prototype.getSchema = function (url, urlHistory) {
+	var schema;
+	if (this.schemas[url] !== undefined) {
+		schema = this.schemas[url];
+		return this.resolveRefs(schema, urlHistory);
+	}
+	var baseUrl = url;
+	var fragment = "";
+	if (url.indexOf('#') !== -1) {
+		fragment = url.substring(url.indexOf("#") + 1);
+		baseUrl = url.substring(0, url.indexOf("#"));
+	}
+	if (typeof this.schemas[baseUrl] === 'object') {
+		schema = this.schemas[baseUrl];
+		var pointerPath = decodeURIComponent(fragment);
+		if (pointerPath === "") {
+			return this.resolveRefs(schema, urlHistory);
+		} else if (pointerPath.charAt(0) !== "/") {
+			return undefined;
+		}
+		var parts = pointerPath.split("/").slice(1);
+		for (var i = 0; i < parts.length; i++) {
+			var component = parts[i].replace(/~1/g, "/").replace(/~0/g, "~");
+			if (schema[component] === undefined) {
+				schema = undefined;
+				break;
+			}
+			schema = schema[component];
+		}
+		if (schema !== undefined) {
+			return this.resolveRefs(schema, urlHistory);
+		}
+	}
+	if (this.missing[baseUrl] === undefined) {
+		this.missing.push(baseUrl);
+		this.missing[baseUrl] = baseUrl;
+		this.missingMap[baseUrl] = baseUrl;
+	}
+};
+ValidatorContext.prototype.searchSchemas = function (schema, url) {
+	if (schema && typeof schema === "object") {
+		if (typeof schema.id === "string") {
+			if (isTrustedUrl(url, schema.id)) {
+				if (this.schemas[schema.id] === undefined) {
+					this.schemas[schema.id] = schema;
+				}
+			}
+		}
+		for (var key in schema) {
+			if (key !== "enum") {
+				if (typeof schema[key] === "object") {
+					this.searchSchemas(schema[key], url);
+				} else if (key === "$ref") {
+					var uri = getDocumentUri(schema[key]);
+					if (uri && this.schemas[uri] === undefined && this.missingMap[uri] === undefined) {
+						this.missingMap[uri] = uri;
+					}
+				}
+			}
+		}
+	}
+};
+ValidatorContext.prototype.addSchema = function (url, schema) {
+	//overload
+	if (typeof url !== 'string' || typeof schema === 'undefined') {
+		if (typeof url === 'object' && typeof url.id === 'string') {
+			schema = url;
+			url = schema.id;
+		}
+		else {
+			return;
+		}
+	}
+	if (url = getDocumentUri(url) + "#") {
+		// Remove empty fragment
+		url = getDocumentUri(url);
+	}
+	this.schemas[url] = schema;
+	delete this.missingMap[url];
+	normSchema(schema, url);
+	this.searchSchemas(schema, url);
+};
+
+ValidatorContext.prototype.getSchemaMap = function () {
+	var map = {};
+	for (var key in this.schemas) {
+		map[key] = this.schemas[key];
+	}
+	return map;
+};
+
+ValidatorContext.prototype.getSchemaUris = function (filterRegExp) {
+	var list = [];
+	for (var key in this.schemas) {
+		if (!filterRegExp || filterRegExp.test(key)) {
+			list.push(key);
+		}
+	}
+	return list;
+};
+
+ValidatorContext.prototype.getMissingUris = function (filterRegExp) {
+	var list = [];
+	for (var key in this.missingMap) {
+		if (!filterRegExp || filterRegExp.test(key)) {
+			list.push(key);
+		}
+	}
+	return list;
+};
+
+ValidatorContext.prototype.dropSchemas = function () {
+	this.schemas = {};
+	this.reset();
+};
+ValidatorContext.prototype.reset = function () {
+	this.missing = [];
+	this.missingMap = {};
+	this.errors = [];
+};
+
+ValidatorContext.prototype.validateAll = function (data, schema, dataPathParts, schemaPathParts, dataPointerPath) {
+	var topLevel;
+	schema = this.resolveRefs(schema);
+	if (!schema) {
+		return null;
+	} else if (schema instanceof ValidationError) {
+		this.errors.push(schema);
+		return schema;
+	}
+
+	var startErrorCount = this.errors.length;
+	var frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null;
+	if (this.checkRecursive && data && typeof data === 'object') {
+		topLevel = !this.scanned.length;
+		if (data[this.validatedSchemasKey]) {
+			var schemaIndex = data[this.validatedSchemasKey].indexOf(schema);
+			if (schemaIndex !== -1) {
+				this.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]);
+				return null;
+			}
+		}
+		if (Object.isFrozen(data)) {
+			frozenIndex = this.scannedFrozen.indexOf(data);
+			if (frozenIndex !== -1) {
+				var frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema);
+				if (frozenSchemaIndex !== -1) {
+					this.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]);
+					return null;
+				}
+			}
+		}
+		this.scanned.push(data);
+		if (Object.isFrozen(data)) {
+			if (frozenIndex === -1) {
+				frozenIndex = this.scannedFrozen.length;
+				this.scannedFrozen.push(data);
+				this.scannedFrozenSchemas.push([]);
+			}
+			scannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length;
+			this.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema;
+			this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = [];
+		} else {
+			if (!data[this.validatedSchemasKey]) {
+				try {
+					Object.defineProperty(data, this.validatedSchemasKey, {
+						value: [],
+						configurable: true
+					});
+					Object.defineProperty(data, this.validationErrorsKey, {
+						value: [],
+						configurable: true
+					});
+				} catch (e) {
+					//IE 7/8 workaround
+					data[this.validatedSchemasKey] = [];
+					data[this.validationErrorsKey] = [];
+				}
+			}
+			scannedSchemasIndex = data[this.validatedSchemasKey].length;
+			data[this.validatedSchemasKey][scannedSchemasIndex] = schema;
+			data[this.validationErrorsKey][scannedSchemasIndex] = [];
+		}
+	}
+
+	var errorCount = this.errors.length;
+	var error = this.validateBasic(data, schema, dataPointerPath)
+		|| this.validateNumeric(data, schema, dataPointerPath)
+		|| this.validateString(data, schema, dataPointerPath)
+		|| this.validateArray(data, schema, dataPointerPath)
+		|| this.validateObject(data, schema, dataPointerPath)
+		|| this.validateCombinations(data, schema, dataPointerPath)
+		|| this.validateFormat(data, schema, dataPointerPath)
+		|| null;
+
+	if (topLevel) {
+		while (this.scanned.length) {
+			var item = this.scanned.pop();
+			delete item[this.validatedSchemasKey];
+		}
+		this.scannedFrozen = [];
+		this.scannedFrozenSchemas = [];
+	}
+
+	if (error || errorCount !== this.errors.length) {
+		while ((dataPathParts && dataPathParts.length) || (schemaPathParts && schemaPathParts.length)) {
+			var dataPart = (dataPathParts && dataPathParts.length) ? "" + dataPathParts.pop() : null;
+			var schemaPart = (schemaPathParts && schemaPathParts.length) ? "" + schemaPathParts.pop() : null;
+			if (error) {
+				error = error.prefixWith(dataPart, schemaPart);
+			}
+			this.prefixErrors(errorCount, dataPart, schemaPart);
+		}
+	}
+	
+	if (scannedFrozenSchemaIndex !== null) {
+		this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount);
+	} else if (scannedSchemasIndex !== null) {
+		data[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount);
+	}
+
+	return this.handleError(error);
+};
+ValidatorContext.prototype.validateFormat = function (data, schema) {
+	if (typeof schema.format !== 'string' || !this.formatValidators[schema.format]) {
+		return null;
+	}
+	var errorMessage = this.formatValidators[schema.format].call(null, data, schema);
+	if (typeof errorMessage === 'string' || typeof errorMessage === 'number') {
+		return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage}).prefixWith(null, "format");
+	} else if (errorMessage && typeof errorMessage === 'object') {
+		return this.createError(ErrorCodes.FORMAT_CUSTOM, {message: errorMessage.message || "?"}, errorMessage.dataPath || null, errorMessage.schemaPath || "/format");
+	}
+	return null;
+};
+
+function recursiveCompare(A, B) {
+	if (A === B) {
+		return true;
+	}
+	if (typeof A === "object" && typeof B === "object") {
+		if (Array.isArray(A) !== Array.isArray(B)) {
+			return false;
+		} else if (Array.isArray(A)) {
+			if (A.length !== B.length) {
+				return false;
+			}
+			for (var i = 0; i < A.length; i++) {
+				if (!recursiveCompare(A[i], B[i])) {
+					return false;
+				}
+			}
+		} else {
+			var key;
+			for (key in A) {
+				if (B[key] === undefined && A[key] !== undefined) {
+					return false;
+				}
+			}
+			for (key in B) {
+				if (A[key] === undefined && B[key] !== undefined) {
+					return false;
+				}
+			}
+			for (key in A) {
+				if (!recursiveCompare(A[key], B[key])) {
+					return false;
+				}
+			}
+		}
+		return true;
+	}
+	return false;
+}
+
+ValidatorContext.prototype.validateBasic = function validateBasic(data, schema, dataPointerPath) {
+	var error;
+	if (error = this.validateType(data, schema, dataPointerPath)) {
+		return error.prefixWith(null, "type");
+	}
+	if (error = this.validateEnum(data, schema, dataPointerPath)) {
+		return error.prefixWith(null, "type");
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateType = function validateType(data, schema) {
+	if (schema.type === undefined) {
+		return null;
+	}
+	var dataType = typeof data;
+	if (data === null) {
+		dataType = "null";
+	} else if (Array.isArray(data)) {
+		dataType = "array";
+	}
+	var allowedTypes = schema.type;
+	if (typeof allowedTypes !== "object") {
+		allowedTypes = [allowedTypes];
+	}
+
+	for (var i = 0; i < allowedTypes.length; i++) {
+		var type = allowedTypes[i];
+		if (type === dataType || (type === "integer" && dataType === "number" && (data % 1 === 0))) {
+			return null;
+		}
+	}
+	return this.createError(ErrorCodes.INVALID_TYPE, {type: dataType, expected: allowedTypes.join("/")});
+};
+
+ValidatorContext.prototype.validateEnum = function validateEnum(data, schema) {
+	if (schema["enum"] === undefined) {
+		return null;
+	}
+	for (var i = 0; i < schema["enum"].length; i++) {
+		var enumVal = schema["enum"][i];
+		if (recursiveCompare(data, enumVal)) {
+			return null;
+		}
+	}
+	return this.createError(ErrorCodes.ENUM_MISMATCH, {value: (typeof JSON !== 'undefined') ? JSON.stringify(data) : data});
+};
+
+ValidatorContext.prototype.validateNumeric = function validateNumeric(data, schema, dataPointerPath) {
+	return this.validateMultipleOf(data, schema, dataPointerPath)
+		|| this.validateMinMax(data, schema, dataPointerPath)
+		|| null;
+};
+
+ValidatorContext.prototype.validateMultipleOf = function validateMultipleOf(data, schema) {
+	var multipleOf = schema.multipleOf || schema.divisibleBy;
+	if (multipleOf === undefined) {
+		return null;
+	}
+	if (typeof data === "number") {
+		if (data % multipleOf !== 0) {
+			return this.createError(ErrorCodes.NUMBER_MULTIPLE_OF, {value: data, multipleOf: multipleOf});
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateMinMax = function validateMinMax(data, schema) {
+	if (typeof data !== "number") {
+		return null;
+	}
+	if (schema.minimum !== undefined) {
+		if (data < schema.minimum) {
+			return this.createError(ErrorCodes.NUMBER_MINIMUM, {value: data, minimum: schema.minimum}).prefixWith(null, "minimum");
+		}
+		if (schema.exclusiveMinimum && data === schema.minimum) {
+			return this.createError(ErrorCodes.NUMBER_MINIMUM_EXCLUSIVE, {value: data, minimum: schema.minimum}).prefixWith(null, "exclusiveMinimum");
+		}
+	}
+	if (schema.maximum !== undefined) {
+		if (data > schema.maximum) {
+			return this.createError(ErrorCodes.NUMBER_MAXIMUM, {value: data, maximum: schema.maximum}).prefixWith(null, "maximum");
+		}
+		if (schema.exclusiveMaximum && data === schema.maximum) {
+			return this.createError(ErrorCodes.NUMBER_MAXIMUM_EXCLUSIVE, {value: data, maximum: schema.maximum}).prefixWith(null, "exclusiveMaximum");
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateString = function validateString(data, schema, dataPointerPath) {
+	return this.validateStringLength(data, schema, dataPointerPath)
+		|| this.validateStringPattern(data, schema, dataPointerPath)
+		|| null;
+};
+
+ValidatorContext.prototype.validateStringLength = function validateStringLength(data, schema) {
+	if (typeof data !== "string") {
+		return null;
+	}
+	if (schema.minLength !== undefined) {
+		if (data.length < schema.minLength) {
+			return this.createError(ErrorCodes.STRING_LENGTH_SHORT, {length: data.length, minimum: schema.minLength}).prefixWith(null, "minLength");
+		}
+	}
+	if (schema.maxLength !== undefined) {
+		if (data.length > schema.maxLength) {
+			return this.createError(ErrorCodes.STRING_LENGTH_LONG, {length: data.length, maximum: schema.maxLength}).prefixWith(null, "maxLength");
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateStringPattern = function validateStringPattern(data, schema) {
+	if (typeof data !== "string" || schema.pattern === undefined) {
+		return null;
+	}
+	var regexp = new RegExp(schema.pattern);
+	if (!regexp.test(data)) {
+		return this.createError(ErrorCodes.STRING_PATTERN, {pattern: schema.pattern}).prefixWith(null, "pattern");
+	}
+	return null;
+};
+ValidatorContext.prototype.validateArray = function validateArray(data, schema, dataPointerPath) {
+	if (!Array.isArray(data)) {
+		return null;
+	}
+	return this.validateArrayLength(data, schema, dataPointerPath)
+		|| this.validateArrayUniqueItems(data, schema, dataPointerPath)
+		|| this.validateArrayItems(data, schema, dataPointerPath)
+		|| null;
+};
+
+ValidatorContext.prototype.validateArrayLength = function validateArrayLength(data, schema) {
+	var error;
+	if (schema.minItems !== undefined) {
+		if (data.length < schema.minItems) {
+			error = (this.createError(ErrorCodes.ARRAY_LENGTH_SHORT, {length: data.length, minimum: schema.minItems})).prefixWith(null, "minItems");
+			if (this.handleError(error)) {
+				return error;
+			}
+		}
+	}
+	if (schema.maxItems !== undefined) {
+		if (data.length > schema.maxItems) {
+			error = (this.createError(ErrorCodes.ARRAY_LENGTH_LONG, {length: data.length, maximum: schema.maxItems})).prefixWith(null, "maxItems");
+			if (this.handleError(error)) {
+				return error;
+			}
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateArrayUniqueItems = function validateArrayUniqueItems(data, schema) {
+	if (schema.uniqueItems) {
+		for (var i = 0; i < data.length; i++) {
+			for (var j = i + 1; j < data.length; j++) {
+				if (recursiveCompare(data[i], data[j])) {
+					var error = (this.createError(ErrorCodes.ARRAY_UNIQUE, {match1: i, match2: j})).prefixWith(null, "uniqueItems");
+					if (this.handleError(error)) {
+						return error;
+					}
+				}
+			}
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateArrayItems = function validateArrayItems(data, schema, dataPointerPath) {
+	if (schema.items === undefined) {
+		return null;
+	}
+	var error, i;
+	if (Array.isArray(schema.items)) {
+		for (i = 0; i < data.length; i++) {
+			if (i < schema.items.length) {
+				if (error = this.validateAll(data[i], schema.items[i], [i], ["items", i], dataPointerPath + "/" + i)) {
+					return error;
+				}
+			} else if (schema.additionalItems !== undefined) {
+				if (typeof schema.additionalItems === "boolean") {
+					if (!schema.additionalItems) {
+						error = (this.createError(ErrorCodes.ARRAY_ADDITIONAL_ITEMS, {})).prefixWith("" + i, "additionalItems");
+						if (this.handleError(error)) {
+							return error;
+						}
+					}
+				} else if (error = this.validateAll(data[i], schema.additionalItems, [i], ["additionalItems"], dataPointerPath + "/" + i)) {
+					return error;
+				}
+			}
+		}
+	} else {
+		for (i = 0; i < data.length; i++) {
+			if (error = this.validateAll(data[i], schema.items, [i], ["items"], dataPointerPath + "/" + i)) {
+				return error;
+			}
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateObject = function validateObject(data, schema, dataPointerPath) {
+	if (typeof data !== "object" || data === null || Array.isArray(data)) {
+		return null;
+	}
+	return this.validateObjectMinMaxProperties(data, schema, dataPointerPath)
+		|| this.validateObjectRequiredProperties(data, schema, dataPointerPath)
+		|| this.validateObjectProperties(data, schema, dataPointerPath)
+		|| this.validateObjectDependencies(data, schema, dataPointerPath)
+		|| null;
+};
+
+ValidatorContext.prototype.validateObjectMinMaxProperties = function validateObjectMinMaxProperties(data, schema) {
+	var keys = Object.keys(data);
+	var error;
+	if (schema.minProperties !== undefined) {
+		if (keys.length < schema.minProperties) {
+			error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MINIMUM, {propertyCount: keys.length, minimum: schema.minProperties}).prefixWith(null, "minProperties");
+			if (this.handleError(error)) {
+				return error;
+			}
+		}
+	}
+	if (schema.maxProperties !== undefined) {
+		if (keys.length > schema.maxProperties) {
+			error = this.createError(ErrorCodes.OBJECT_PROPERTIES_MAXIMUM, {propertyCount: keys.length, maximum: schema.maxProperties}).prefixWith(null, "maxProperties");
+			if (this.handleError(error)) {
+				return error;
+			}
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateObjectRequiredProperties = function validateObjectRequiredProperties(data, schema) {
+	if (schema.required !== undefined) {
+		for (var i = 0; i < schema.required.length; i++) {
+			var key = schema.required[i];
+			if (data[key] === undefined) {
+				var error = this.createError(ErrorCodes.OBJECT_REQUIRED, {key: key}).prefixWith(null, "" + i).prefixWith(null, "required");
+				if (this.handleError(error)) {
+					return error;
+				}
+			}
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateObjectProperties = function validateObjectProperties(data, schema, dataPointerPath) {
+	var error;
+	for (var key in data) {
+		var keyPointerPath = dataPointerPath + "/" + key.replace(/~/g, '~0').replace(/\//g, '~1');
+		var foundMatch = false;
+		if (schema.properties !== undefined && schema.properties[key] !== undefined) {
+			foundMatch = true;
+			if (error = this.validateAll(data[key], schema.properties[key], [key], ["properties", key], keyPointerPath)) {
+				return error;
+			}
+		}
+		if (schema.patternProperties !== undefined) {
+			for (var patternKey in schema.patternProperties) {
+				var regexp = new RegExp(patternKey);
+				if (regexp.test(key)) {
+					foundMatch = true;
+					if (error = this.validateAll(data[key], schema.patternProperties[patternKey], [key], ["patternProperties", patternKey], keyPointerPath)) {
+						return error;
+					}
+				}
+			}
+		}
+		if (!foundMatch) {
+			if (schema.additionalProperties !== undefined) {
+				if (this.trackUnknownProperties) {
+					this.knownPropertyPaths[keyPointerPath] = true;
+					delete this.unknownPropertyPaths[keyPointerPath];
+				}
+				if (typeof schema.additionalProperties === "boolean") {
+					if (!schema.additionalProperties) {
+						error = this.createError(ErrorCodes.OBJECT_ADDITIONAL_PROPERTIES, {}).prefixWith(key, "additionalProperties");
+						if (this.handleError(error)) {
+							return error;
+						}
+					}
+				} else {
+					if (error = this.validateAll(data[key], schema.additionalProperties, [key], ["additionalProperties"], keyPointerPath)) {
+						return error;
+					}
+				}
+			} else if (this.trackUnknownProperties && !this.knownPropertyPaths[keyPointerPath]) {
+				this.unknownPropertyPaths[keyPointerPath] = true;
+			}
+		} else if (this.trackUnknownProperties) {
+			this.knownPropertyPaths[keyPointerPath] = true;
+			delete this.unknownPropertyPaths[keyPointerPath];
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateObjectDependencies = function validateObjectDependencies(data, schema, dataPointerPath) {
+	var error;
+	if (schema.dependencies !== undefined) {
+		for (var depKey in schema.dependencies) {
+			if (data[depKey] !== undefined) {
+				var dep = schema.dependencies[depKey];
+				if (typeof dep === "string") {
+					if (data[dep] === undefined) {
+						error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: dep}).prefixWith(null, depKey).prefixWith(null, "dependencies");
+						if (this.handleError(error)) {
+							return error;
+						}
+					}
+				} else if (Array.isArray(dep)) {
+					for (var i = 0; i < dep.length; i++) {
+						var requiredKey = dep[i];
+						if (data[requiredKey] === undefined) {
+							error = this.createError(ErrorCodes.OBJECT_DEPENDENCY_KEY, {key: depKey, missing: requiredKey}).prefixWith(null, "" + i).prefixWith(null, depKey).prefixWith(null, "dependencies");
+							if (this.handleError(error)) {
+								return error;
+							}
+						}
+					}
+				} else {
+					if (error = this.validateAll(data, dep, [], ["dependencies", depKey], dataPointerPath)) {
+						return error;
+					}
+				}
+			}
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateCombinations = function validateCombinations(data, schema, dataPointerPath) {
+	return this.validateAllOf(data, schema, dataPointerPath)
+		|| this.validateAnyOf(data, schema, dataPointerPath)
+		|| this.validateOneOf(data, schema, dataPointerPath)
+		|| this.validateNot(data, schema, dataPointerPath)
+		|| null;
+};
+
+ValidatorContext.prototype.validateAllOf = function validateAllOf(data, schema, dataPointerPath) {
+	if (schema.allOf === undefined) {
+		return null;
+	}
+	var error;
+	for (var i = 0; i < schema.allOf.length; i++) {
+		var subSchema = schema.allOf[i];
+		if (error = this.validateAll(data, subSchema, [], ["allOf", i], dataPointerPath)) {
+			return error;
+		}
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateAnyOf = function validateAnyOf(data, schema, dataPointerPath) {
+	if (schema.anyOf === undefined) {
+		return null;
+	}
+	var errors = [];
+	var startErrorCount = this.errors.length;
+	var oldUnknownPropertyPaths, oldKnownPropertyPaths;
+	if (this.trackUnknownProperties) {
+		oldUnknownPropertyPaths = this.unknownPropertyPaths;
+		oldKnownPropertyPaths = this.knownPropertyPaths;
+	}
+	var errorAtEnd = true;
+	for (var i = 0; i < schema.anyOf.length; i++) {
+		if (this.trackUnknownProperties) {
+			this.unknownPropertyPaths = {};
+			this.knownPropertyPaths = {};
+		}
+		var subSchema = schema.anyOf[i];
+
+		var errorCount = this.errors.length;
+		var error = this.validateAll(data, subSchema, [], ["anyOf", i], dataPointerPath);
+
+		if (error === null && errorCount === this.errors.length) {
+			this.errors = this.errors.slice(0, startErrorCount);
+
+			if (this.trackUnknownProperties) {
+				for (var knownKey in this.knownPropertyPaths) {
+					oldKnownPropertyPaths[knownKey] = true;
+					delete oldUnknownPropertyPaths[knownKey];
+				}
+				for (var unknownKey in this.unknownPropertyPaths) {
+					if (!oldKnownPropertyPaths[unknownKey]) {
+						oldUnknownPropertyPaths[unknownKey] = true;
+					}
+				}
+				// We need to continue looping so we catch all the property definitions, but we don't want to return an error
+				errorAtEnd = false;
+				continue;
+			}
+
+			return null;
+		}
+		if (error) {
+			errors.push(error.prefixWith(null, "" + i).prefixWith(null, "anyOf"));
+		}
+	}
+	if (this.trackUnknownProperties) {
+		this.unknownPropertyPaths = oldUnknownPropertyPaths;
+		this.knownPropertyPaths = oldKnownPropertyPaths;
+	}
+	if (errorAtEnd) {
+		errors = errors.concat(this.errors.slice(startErrorCount));
+		this.errors = this.errors.slice(0, startErrorCount);
+		return this.createError(ErrorCodes.ANY_OF_MISSING, {}, "", "/anyOf", errors);
+	}
+};
+
+ValidatorContext.prototype.validateOneOf = function validateOneOf(data, schema, dataPointerPath) {
+	if (schema.oneOf === undefined) {
+		return null;
+	}
+	var validIndex = null;
+	var errors = [];
+	var startErrorCount = this.errors.length;
+	var oldUnknownPropertyPaths, oldKnownPropertyPaths;
+	if (this.trackUnknownProperties) {
+		oldUnknownPropertyPaths = this.unknownPropertyPaths;
+		oldKnownPropertyPaths = this.knownPropertyPaths;
+	}
+	for (var i = 0; i < schema.oneOf.length; i++) {
+		if (this.trackUnknownProperties) {
+			this.unknownPropertyPaths = {};
+			this.knownPropertyPaths = {};
+		}
+		var subSchema = schema.oneOf[i];
+
+		var errorCount = this.errors.length;
+		var error = this.validateAll(data, subSchema, [], ["oneOf", i], dataPointerPath);
+
+		if (error === null && errorCount === this.errors.length) {
+			if (validIndex === null) {
+				validIndex = i;
+			} else {
+				this.errors = this.errors.slice(0, startErrorCount);
+				return this.createError(ErrorCodes.ONE_OF_MULTIPLE, {index1: validIndex, index2: i}, "", "/oneOf");
+			}
+			if (this.trackUnknownProperties) {
+				for (var knownKey in this.knownPropertyPaths) {
+					oldKnownPropertyPaths[knownKey] = true;
+					delete oldUnknownPropertyPaths[knownKey];
+				}
+				for (var unknownKey in this.unknownPropertyPaths) {
+					if (!oldKnownPropertyPaths[unknownKey]) {
+						oldUnknownPropertyPaths[unknownKey] = true;
+					}
+				}
+			}
+		} else if (error) {
+			errors.push(error.prefixWith(null, "" + i).prefixWith(null, "oneOf"));
+		}
+	}
+	if (this.trackUnknownProperties) {
+		this.unknownPropertyPaths = oldUnknownPropertyPaths;
+		this.knownPropertyPaths = oldKnownPropertyPaths;
+	}
+	if (validIndex === null) {
+		errors = errors.concat(this.errors.slice(startErrorCount));
+		this.errors = this.errors.slice(0, startErrorCount);
+		return this.createError(ErrorCodes.ONE_OF_MISSING, {}, "", "/oneOf", errors);
+	} else {
+		this.errors = this.errors.slice(0, startErrorCount);
+	}
+	return null;
+};
+
+ValidatorContext.prototype.validateNot = function validateNot(data, schema, dataPointerPath) {
+	if (schema.not === undefined) {
+		return null;
+	}
+	var oldErrorCount = this.errors.length;
+	var oldUnknownPropertyPaths, oldKnownPropertyPaths;
+	if (this.trackUnknownProperties) {
+		oldUnknownPropertyPaths = this.unknownPropertyPaths;
+		oldKnownPropertyPaths = this.knownPropertyPaths;
+		this.unknownPropertyPaths = {};
+		this.knownPropertyPaths = {};
+	}
+	var error = this.validateAll(data, schema.not, null, null, dataPointerPath);
+	var notErrors = this.errors.slice(oldErrorCount);
+	this.errors = this.errors.slice(0, oldErrorCount);
+	if (this.trackUnknownProperties) {
+		this.unknownPropertyPaths = oldUnknownPropertyPaths;
+		this.knownPropertyPaths = oldKnownPropertyPaths;
+	}
+	if (error === null && notErrors.length === 0) {
+		return this.createError(ErrorCodes.NOT_PASSED, {}, "", "/not");
+	}
+	return null;
+};
+
+// parseURI() and resolveUrl() are from https://gist.github.com/1088850
+//   -  released as public domain by author ("Yaffle") - see comments on gist
+
+function parseURI(url) {
+	var m = String(url).replace(/^\s+|\s+$/g, '').match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
+	// authority = '//' + user + ':' + pass '@' + hostname + ':' port
+	return (m ? {
+		href     : m[0] || '',
+		protocol : m[1] || '',
+		authority: m[2] || '',
+		host     : m[3] || '',
+		hostname : m[4] || '',
+		port     : m[5] || '',
+		pathname : m[6] || '',
+		search   : m[7] || '',
+		hash     : m[8] || ''
+	} : null);
+}
+
+function resolveUrl(base, href) {// RFC 3986
+
+	function removeDotSegments(input) {
+		var output = [];
+		input.replace(/^(\.\.?(\/|$))+/, '')
+			.replace(/\/(\.(\/|$))+/g, '/')
+			.replace(/\/\.\.$/, '/../')
+			.replace(/\/?[^\/]*/g, function (p) {
+				if (p === '/..') {
+					output.pop();
+				} else {
+					output.push(p);
+				}
+		});
+		return output.join('').replace(/^\//, input.charAt(0) === '/' ? '/' : '');
+	}
+
+	href = parseURI(href || '');
+	base = parseURI(base || '');
+
+	return !href || !base ? null : (href.protocol || base.protocol) +
+		(href.protocol || href.authority ? href.authority : base.authority) +
+		removeDotSegments(href.protocol || href.authority || href.pathname.charAt(0) === '/' ? href.pathname : (href.pathname ? ((base.authority && !base.pathname ? '/' : '') + base.pathname.slice(0, base.pathname.lastIndexOf('/') + 1) + href.pathname) : base.pathname)) +
+		(href.protocol || href.authority || href.pathname ? href.search : (href.search || base.search)) +
+		href.hash;
+}
+
+function getDocumentUri(uri) {
+	return uri.split('#')[0];
+}
+function normSchema(schema, baseUri) {
+	if (schema && typeof schema === "object") {
+		if (baseUri === undefined) {
+			baseUri = schema.id;
+		} else if (typeof schema.id === "string") {
+			baseUri = resolveUrl(baseUri, schema.id);
+			schema.id = baseUri;
+		}
+		if (Array.isArray(schema)) {
+			for (var i = 0; i < schema.length; i++) {
+				normSchema(schema[i], baseUri);
+			}
+		} else if (typeof schema['$ref'] === "string") {
+			schema['$ref'] = resolveUrl(baseUri, schema['$ref']);
+		} else {
+			for (var key in schema) {
+				if (key !== "enum") {
+					normSchema(schema[key], baseUri);
+				}
+			}
+		}
+	}
+}
+
+var ErrorCodes = {
+	INVALID_TYPE: 0,
+	ENUM_MISMATCH: 1,
+	ANY_OF_MISSING: 10,
+	ONE_OF_MISSING: 11,
+	ONE_OF_MULTIPLE: 12,
+	NOT_PASSED: 13,
+	// Numeric errors
+	NUMBER_MULTIPLE_OF: 100,
+	NUMBER_MINIMUM: 101,
+	NUMBER_MINIMUM_EXCLUSIVE: 102,
+	NUMBER_MAXIMUM: 103,
+	NUMBER_MAXIMUM_EXCLUSIVE: 104,
+	// String errors
+	STRING_LENGTH_SHORT: 200,
+	STRING_LENGTH_LONG: 201,
+	STRING_PATTERN: 202,
+	// Object errors
+	OBJECT_PROPERTIES_MINIMUM: 300,
+	OBJECT_PROPERTIES_MAXIMUM: 301,
+	OBJECT_REQUIRED: 302,
+	OBJECT_ADDITIONAL_PROPERTIES: 303,
+	OBJECT_DEPENDENCY_KEY: 304,
+	// Array errors
+	ARRAY_LENGTH_SHORT: 400,
+	ARRAY_LENGTH_LONG: 401,
+	ARRAY_UNIQUE: 402,
+	ARRAY_ADDITIONAL_ITEMS: 403,
+	// Format errors
+	FORMAT_CUSTOM: 500,
+	// Schema structure
+	CIRCULAR_REFERENCE: 600,
+	// Non-standard validation options
+	UNKNOWN_PROPERTY: 1000
+};
+var ErrorMessagesDefault = {
+	INVALID_TYPE: "invalid type: {type} (expected {expected})",
+	ENUM_MISMATCH: "No enum match for: {value}",
+	ANY_OF_MISSING: "Data does not match any schemas from \"anyOf\"",
+	ONE_OF_MISSING: "Data does not match any schemas from \"oneOf\"",
+	ONE_OF_MULTIPLE: "Data is valid against more than one schema from \"oneOf\": indices {index1} and {index2}",
+	NOT_PASSED: "Data matches schema from \"not\"",
+	// Numeric errors
+	NUMBER_MULTIPLE_OF: "Value {value} is not a multiple of {multipleOf}",
+	NUMBER_MINIMUM: "Value {value} is less than minimum {minimum}",
+	NUMBER_MINIMUM_EXCLUSIVE: "Value {value} is equal to exclusive minimum {minimum}",
+	NUMBER_MAXIMUM: "Value {value} is greater than maximum {maximum}",
+	NUMBER_MAXIMUM_EXCLUSIVE: "Value {value} is equal to exclusive maximum {maximum}",
+	// String errors
+	STRING_LENGTH_SHORT: "String is too short ({length} chars), minimum {minimum}",
+	STRING_LENGTH_LONG: "String is too long ({length} chars), maximum {maximum}",
+	STRING_PATTERN: "String does not match pattern: {pattern}",
+	// Object errors
+	OBJECT_PROPERTIES_MINIMUM: "Too few properties defined ({propertyCount}), minimum {minimum}",
+	OBJECT_PROPERTIES_MAXIMUM: "Too many properties defined ({propertyCount}), maximum {maximum}",
+	OBJECT_REQUIRED: "Missing required property: {key}",
+	OBJECT_ADDITIONAL_PROPERTIES: "Additional properties not allowed",
+	OBJECT_DEPENDENCY_KEY: "Dependency failed - key must exist: {missing} (due to key: {key})",
+	// Array errors
+	ARRAY_LENGTH_SHORT: "Array is too short ({length}), minimum {minimum}",
+	ARRAY_LENGTH_LONG: "Array is too long ({length}), maximum {maximum}",
+	ARRAY_UNIQUE: "Array items are not unique (indices {match1} and {match2})",
+	ARRAY_ADDITIONAL_ITEMS: "Additional items not allowed",
+	// Format errors
+	FORMAT_CUSTOM: "Format validation failed ({message})",
+	// Schema structure
+	CIRCULAR_REFERENCE: "Circular $refs: {urls}",
+	// Non-standard validation options
+	UNKNOWN_PROPERTY: "Unknown property (not in schema)"
+};
+
+function ValidationError(code, message, dataPath, schemaPath, subErrors) {
+	Error.call(this);
+	if (code === undefined) {
+		throw new Error ("No code supplied for error: "+ message);
+	}
+	this.message = message;
+	this.code = code;
+	this.dataPath = dataPath || "";
+	this.schemaPath = schemaPath || "";
+	this.subErrors = subErrors || null;
+
+	var err = new Error(this.message);
+	this.stack = err.stack || err.stacktrace;
+	if (!this.stack) {
+		try {
+			throw err;
+		}
+		catch(err) {
+			this.stack = err.stack || err.stacktrace;
+		}
+	}
+}
+ValidationError.prototype = Object.create(Error.prototype);
+ValidationError.prototype.constructor = ValidationError;
+ValidationError.prototype.name = 'ValidationError';
+
+ValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) {
+	if (dataPrefix !== null) {
+		dataPrefix = dataPrefix.replace(/~/g, "~0").replace(/\//g, "~1");
+		this.dataPath = "/" + dataPrefix + this.dataPath;
+	}
+	if (schemaPrefix !== null) {
+		schemaPrefix = schemaPrefix.replace(/~/g, "~0").replace(/\//g, "~1");
+		this.schemaPath = "/" + schemaPrefix + this.schemaPath;
+	}
+	if (this.subErrors !== null) {
+		for (var i = 0; i < this.subErrors.length; i++) {
+			this.subErrors[i].prefixWith(dataPrefix, schemaPrefix);
+		}
+	}
+	return this;
+};
+
+function isTrustedUrl(baseUrl, testUrl) {
+	if(testUrl.substring(0, baseUrl.length) === baseUrl){
+		var remainder = testUrl.substring(baseUrl.length);
+		if ((testUrl.length > 0 && testUrl.charAt(baseUrl.length - 1) === "/")
+			|| remainder.charAt(0) === "#"
+			|| remainder.charAt(0) === "?") {
+			return true;
+		}
+	}
+	return false;
+}
+
+var languages = {};
+function createApi(language) {
+	var globalContext = new ValidatorContext();
+	var currentLanguage = language || 'en';
+	var api = {
+		addFormat: function () {
+			globalContext.addFormat.apply(globalContext, arguments);
+		},
+		language: function (code) {
+			if (!code) {
+				return currentLanguage;
+			}
+			if (!languages[code]) {
+				code = code.split('-')[0]; // fall back to base language
+			}
+			if (languages[code]) {
+				currentLanguage = code;
+				return code; // so you can tell if fall-back has happened
+			}
+			return false;
+		},
+		addLanguage: function (code, messageMap) {
+			var key;
+			for (key in ErrorCodes) {
+				if (messageMap[key] && !messageMap[ErrorCodes[key]]) {
+					messageMap[ErrorCodes[key]] = messageMap[key];
+				}
+			}
+			var rootCode = code.split('-')[0];
+			if (!languages[rootCode]) { // use for base language if not yet defined
+				languages[code] = messageMap;
+				languages[rootCode] = messageMap;
+			} else {
+				languages[code] = Object.create(languages[rootCode]);
+				for (key in messageMap) {
+					if (typeof languages[rootCode][key] === 'undefined') {
+						languages[rootCode][key] = messageMap[key];
+					}
+					languages[code][key] = messageMap[key];
+				}
+			}
+			return this;
+		},
+		freshApi: function (language) {
+			var result = createApi();
+			if (language) {
+				result.language(language);
+			}
+			return result;
+		},
+		validate: function (data, schema, checkRecursive, banUnknownProperties) {
+			var context = new ValidatorContext(globalContext, false, languages[currentLanguage], checkRecursive, banUnknownProperties);
+			if (typeof schema === "string") {
+				schema = {"$ref": schema};
+			}
+			context.addSchema("", schema);
+			var error = context.validateAll(data, schema, null, null, "");
+			if (!error && banUnknownProperties) {
+				error = context.banUnknownProperties();
+			}
+			this.error = error;
+			this.missing = context.missing;
+			this.valid = (error === null);
+			return this.valid;
+		},
+		validateResult: function () {
+			var result = {};
+			this.validate.apply(result, arguments);
+			return result;
+		},
+		validateMultiple: function (data, schema, checkRecursive, banUnknownProperties) {
+			var context = new ValidatorContext(globalContext, true, languages[currentLanguage], checkRecursive, banUnknownProperties);
+			if (typeof schema === "string") {
+				schema = {"$ref": schema};
+			}
+			context.addSchema("", schema);
+			context.validateAll(data, schema, null, null, "");
+			if (banUnknownProperties) {
+				context.banUnknownProperties();
+			}
+			var result = {};
+			result.errors = context.errors;
+			result.missing = context.missing;
+			result.valid = (result.errors.length === 0);
+			return result;
+		},
+		addSchema: function () {
+			return globalContext.addSchema.apply(globalContext, arguments);
+		},
+		getSchema: function () {
+			return globalContext.getSchema.apply(globalContext, arguments);
+		},
+		getSchemaMap: function () {
+			return globalContext.getSchemaMap.apply(globalContext, arguments);
+		},
+		getSchemaUris: function () {
+			return globalContext.getSchemaUris.apply(globalContext, arguments);
+		},
+		getMissingUris: function () {
+			return globalContext.getMissingUris.apply(globalContext, arguments);
+		},
+		dropSchemas: function () {
+			globalContext.dropSchemas.apply(globalContext, arguments);
+		},
+		reset: function () {
+			globalContext.reset();
+			this.error = null;
+			this.missing = [];
+			this.valid = true;
+		},
+		missing: [],
+		error: null,
+		valid: true,
+		normSchema: normSchema,
+		resolveUrl: resolveUrl,
+		getDocumentUri: getDocumentUri,
+		errorCodes: ErrorCodes
+	};
+	return api;
+}
+
+var tv4 = createApi();
+tv4.addLanguage('en-gb', ErrorMessagesDefault);
+
+//legacy property
+tv4.tv4 = tv4;
+
+if (typeof module !== 'undefined' && module.exports){
+	module.exports = tv4;
+}
+else {
+	global.tv4 = tv4;
+}
+
+})(this);
Index: Dev/trunk/node_modules/grunt-tv4/package.json
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/package.json	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/package.json	(revision 487)
@@ -0,0 +1,67 @@
+{
+  "name": "grunt-tv4",
+  "description": "Validate values against json-schema v4",
+  "version": "0.4.0",
+  "homepage": "https://github.com/Bartvds/grunt-tv4",
+  "author": {
+    "name": "Bart van der Schoor",
+    "url": "https://github.com/Bartvds"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/Bartvds/grunt-tv4"
+  },
+  "bugs": {
+    "url": "https://github.com/Bartvds/grunt-tv4/issues"
+  },
+  "licenses": [
+    {
+      "type": "MIT",
+      "url": "https://github.com/Bartvds/grunt-tv4/blob/master/LICENSE-MIT"
+    }
+  ],
+  "keywords": [
+    "gruntplugin",
+    "validate",
+    "validator",
+    "json",
+    "schema",
+    "json-schema",
+    "tv4"
+  ],
+  "main": "Gruntfile.js",
+  "engines": {
+    "node": ">= 0.10.0"
+  },
+  "scripts": {
+    "test": "grunt test"
+  },
+  "dependencies": {
+    "jsonpointer.js": "0.3.0",
+    "request": "2.25.0",
+    "tv4": "~1.0.14",
+    "ministyle": "~0.1.0",
+    "miniwrite": "~0.1.0",
+    "tv4-reporter": "~0.0.3"
+  },
+  "devDependencies": {
+    "grunt-cli": "~0.1",
+    "grunt": "~0.4.1",
+    "grunt-contrib-connect": "~0.3.0",
+    "grunt-continue": "0.0.1",
+    "grunt-contrib-jshint": "~0.7.2",
+    "jshint-path-reporter": "~0.1.3",
+    "package.json-schema": "~0.1.2"
+  },
+  "peerDependencies": {
+    "grunt": "~0.4.1"
+  },
+  "readme": "# grunt-tv4\r\n\r\n[![Build Status](https://secure.travis-ci.org/Bartvds/grunt-tv4.png?branch=master)](http://travis-ci.org/Bartvds/grunt-tv4) [![Dependency Status](https://gemnasium.com/Bartvds/grunt-tv4.png)](https://gemnasium.com/Bartvds/grunt-tv4) [![NPM version](https://badge.fury.io/js/grunt-tv4.png)](http://badge.fury.io/js/grunt-tv4)\r\n\r\n> Use grunt and [Tiny Validator tv4](https://github.com/geraintluff/tv4) to validate values against [json-schema](http://json-schema.org/) draft v4\r\n\r\n## Getting Started\r\n\r\nThis plugin requires Grunt `~0.4.1`\r\n\r\nIf you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:\r\n\r\n```shell\r\n$ npm install grunt-tv4 --save-dev\r\n```\r\n\r\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\r\n\r\n```js\r\ngrunt.loadNpmTasks('grunt-tv4');\r\n```\r\n\r\n## The \"tv4\" task\r\n\r\n### Notes\r\n\r\n* Uses [Tiny Validator tv4 ](https://github.com/geraintluff/tv4) so schemas must conform to [json-schema draft v4](http://json-schema.org/documentation.html).\r\n* Supports automatically resolution and loading remote references by http via `$ref`. \r\n* To use `$ref` see the [json-schema](http://json-schema.org/) documentation or [this help](http://spacetelescope.github.io/understanding-json-schema/structuring.html). \r\n* For general help with json-schema see this excelent [guide](http://spacetelescope.github.io/understanding-json-schema/) and usable [reference](http://spacetelescope.github.io/understanding-json-schema/reference/index.html).\r\n* Errors formatted by the [tv4-reporter](https://github.com/Bartvds/tv4-reporter) library.\r\n\r\n### API change \r\n\r\nAs of version `v0.2.0` the API was changed to follow the Grunt options- and file-selection conventions. The old pattern (which abused the destination-specifier) is no longer supported. The readme for the previous API can be found [here](https://github.com/Bartvds/grunt-tv4/tree/71ef1726945d05efd5daca29f26cbf4ab09c858e).\r\n\r\nThe root schema must now to be specified as `options.root`.\r\n\r\n### Example\r\n\r\n* Demo of version `v0.3.0` output on [travis-ci](https://travis-ci.org/Bartvds/grunt-tv4/jobs/14468920)\r\n\r\n### Basic usage\r\n\r\nValidate from .json files:\r\n\r\n```js\r\ngrunt.initConfig({\r\n\ttv4: {\r\n\t\toptions: {\r\n\t\t    root: grunt.file.readJSON('schema/main.json')\r\n\t\t}\r\n\t\tmyTarget: {\r\n\t\t\tsrc: ['data/*.json']\r\n\t\t}\r\n\t}\r\n})\r\n```\r\n\r\nValdiate values:\r\n\r\n```js\r\ngrunt.initConfig({\r\n\ttv4: {\r\n\t\tmyTarget: {\r\n\t\t\toptions: {\r\n\t\t\t\troot: {\r\n\t\t\t\t\ttype: 'object',\r\n\t\t\t\t\tproperties: { ... }\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tvalues: [\r\n\t\t\t\t{ ... },\r\n\t\t\t\t{ ... }\r\n\t\t\t]\r\n\t\t}\r\n\t}\r\n})\r\n````\r\n\r\n### Advanced usage\r\n\r\n```js\r\ngrunt.initConfig({\r\n\ttv4: {\r\n\t\toptions: {\r\n\t\t\t// specify the main schema, one of:\r\n            // - path to json\r\n            // - http-url\r\n            // - schema object\r\n            // - callback that returns one of the above\r\n\t\t\troot: grunt.file.readJSON('schema/main.json'),\r\n\r\n\t\t\t// show multiple errors per file (off by default)\r\n\t\t\tmulti: true,\r\n\r\n\t\t\t// create a new tv4 instance for every target (off by default)\r\n\t\t\tfresh: true,\r\n\r\n\t\t\t// add schemas in bulk (each required to have an 'id' property) (can be a callback)\r\n\t\t\tadd: [\r\n\t\t\t\t grunt.file.readJSON('schema/apple.json'),\r\n\t\t\t\t grunt.file.readJSON('schema/pear.json')\r\n\t\t\t],\r\n\r\n\t\t\t// set schemas by URI (can be a callback)\r\n\t\t\tschemas: {\r\n\t\t\t\t'http://example.com/schema/apple': grunt.file.readJSON('schema/apple.json'),\r\n\t\t\t\t'http://example.com/schema/pear': grunt.file.readJSON('schema/pear.json')\r\n\t\t\t},\r\n\r\n\t\t\t// map of custom formats passed to tv4.addFormat()\r\n\t\t\tformats: {\r\n\t\t\t\tdate: function (data, schema) {\r\n\t\t\t\t\tif (typeof data !== 'string' || !dateRegex.test(data)) {\r\n\t\t\t\t\t\treturn 'value must be string of the form: YYYY-MM-DD';\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn null;\r\n\t\t\t\t}\r\n\t\t\t},\r\n\r\n\t\t\t// passed to tv4.validate()\r\n\t\t\tcheckRecursive: false\r\n\t\t\t// passed to tv4.validate()\r\n\t\t\tbanUnknownProperties: false\r\n\t\t\t// passed tv4.language()\r\n\t\t\tlanguage: 'de'\r\n\t\t\t// passed tv4.addLanguage()\r\n\t\t\tlanguages: {\r\n\t\t\t\t'de': { ... }\r\n\t\t\t}\r\n\t\t},\r\n\t\t// load json from disk\r\n\t\tmyFiles: {\r\n\t\t\tsrc: ['data/*.json', 'data/fruit/**/*.json']\r\n\t\t},\r\n\r\n\t\tmyValues: {\r\n\t\t\t// validate values\r\n\t\t\tvalues: [\r\n\t\t\t\tgrunt.file.readJSON('data/apple.json'),\r\n\t\t\t\tgrunt.file.readJSON('data/pear.json')\r\n\t\t\t],\r\n\t\t},\r\n\r\n\t\tmyValueMap: {\r\n\t\t\t// alternately pass as object and the keys will be used as labels in the reports\r\n\t\t\tvalues: {\r\n\t\t\t\t'apple': grunt.file.readJSON('data/apple.json'),\r\n\t\t\t\t'pear': grunt.file.readJSON('data/pear.json')\r\n\t\t\t},\r\n\t\t},\r\n\r\n\t\tmyCallback: {\r\n\t\t\t// alternately pass a function() to return a collection of values (array or object)\r\n\t\t\tvalues: function() {\r\n\t\t\t\treturn {\r\n\t\t\t\t\t'apple': grunt.file.readJSON('data/apple.json'),\r\n\t\t\t\t\t'pear': grunt.file.readJSON('data/pear.json')\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n})\r\n```\r\n\r\n## History\r\n\r\n* 0.4.0 - Updated some depedencies. `root`, `add` and `schemas` can be a callback function (for lazy init).\r\n* 0.3.0 - Big internal rewrite:\r\n\t* Added `.values` option. \r\n\t* Extracted reporting to [tv4-reporter](https://github.com/Bartvds/tv4-reporter), [miniwrite](https://github.com/Bartvds/miniwrite) and [ministyle](https://github.com/Bartvds/ministyle).\r\n\t* Moved loader logic to own stand-alone module (for later extraction)\r\n\t* Extracted test-running logic to own module (for later extraction)\r\n* 0.2.1 - Added support to report subErrors (for anyOf/oneOf)\r\n* 0.2.0 - Updated to follow the Grunt conventions.\r\n* 0.1.4 - Updated `tv4` to version `1.0.11` \r\n  * Added support for `tv4.addFormat()` / `languages` / `checkRecursive` / `banUnknownProperties`.\r\n* 0.1.3 - Support for loading remote references (JSON Schema's `$ref`).\r\n* 0.1.1 - Bugfixes and improved reporting\r\n* 0.1.0 - First release with synchronous validation\r\n\r\n\r\n## Contributing\r\nIn lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).\r\n\r\n\r\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/Bartvds/grunt-tv4/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\r\n\r\n",
+  "readmeFilename": "README.md",
+  "_id": "grunt-tv4@0.4.0",
+  "dist": {
+    "shasum": "2b6e01be443cffeb8654e47bf2fa64f7c65fdd0b"
+  },
+  "_from": "grunt-tv4@",
+  "_resolved": "https://registry.npmjs.org/grunt-tv4/-/grunt-tv4-0.4.0.tgz"
+}
Index: Dev/trunk/node_modules/grunt-tv4/tasks/tv4.js
===================================================================
--- Dev/trunk/node_modules/grunt-tv4/tasks/tv4.js	(revision 487)
+++ Dev/trunk/node_modules/grunt-tv4/tasks/tv4.js	(revision 487)
@@ -0,0 +1,126 @@
+/*
+ * grunt-tv4
+ * https://github.com/Bartvds/grunt-tv4
+ *
+ * Copyright (c) 2013 Bart van der Schoor
+ * Licensed under the MIT license.
+ */
+
+'use strict';
+
+var taskTv4 = require('tv4').freshApi();
+var reporter = require('tv4-reporter');
+var ministyle = require('ministyle');
+var miniwrite = require('miniwrite');
+var loader = require('../lib/loader');
+var runnerModule = require('../lib/runner');
+
+//var util = require('util');
+
+module.exports = function (grunt) {
+
+	var out = miniwrite.grunt(grunt);
+	var style = ministyle.grunt();
+	var report = reporter.getReporter(out, style);
+	var runner = runnerModule.getRunner(taskTv4, loader.getLoaders(), out, style);
+
+	grunt.registerMultiTask('tv4', 'Validate values against json-schema v4.', function () {
+		var done = this.async();
+
+		//import options
+		var context = runner.getContext(this.options(runner.getOptions({
+			timeout: 5000
+		})));
+		var objects = [];
+
+		if (context.options.fresh) {
+			context.tv4 = taskTv4.freshApi();
+		}
+		else {
+			context.tv4 = taskTv4;
+		}
+
+		grunt.util._.each(context.options.schemas, function (schema, uri) {
+			context.tv4.addSchema(uri, schema);
+		});
+
+		context.tv4.addFormat(context.options.formats);
+
+		grunt.util._.each(context.options.languages, function (language, id) {
+			context.tv4.addLanguage(id, language);
+		});
+		if (context.options.language) {
+			context.tv4.language(context.options.language);
+		}
+
+		//flatten list for sanity
+		grunt.util._.each(this.files, function (f) {
+			grunt.util._.some(f.src, function (filePath) {
+				if (!grunt.file.exists(filePath)) {
+					grunt.log.warn('file "' + filePath + '" not found.');
+					return true;
+				}
+				objects.push({
+					path: filePath,
+					label: filePath,
+					root: context.options.root
+				});
+			});
+		});
+
+		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+		var values = this.data.values;
+		if (typeof values === 'function') {
+			values = values();
+		}
+
+		if (typeof values === 'object') {
+			var keyPrefix = (Array.isArray(values) ? 'value #' : '');
+			grunt.util._.some(values, function (value, key) {
+				objects.push({
+					label: keyPrefix + key,
+					value: value,
+					root: context.options.root
+				});
+			});
+		}
+		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+		if (context.options.add && Array.isArray(context.options.add)) {
+			grunt.util._.some(context.options.add, function (schema) {
+				if (typeof schema === 'string') {
+					//juggle
+					schema = grunt.file.readJSON(schema);
+				}
+				if (typeof schema.id === 'undefined') {
+					grunt.log.warn('options.add: schema missing required id field (use options.schema to map it manually)');
+					grunt.log.writeln();
+					context.done(false);
+					return true;
+				}
+				context.tv4.addSchema(schema.id, schema);
+			});
+		}
+
+		// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+		//grunt.verbose.writeln(util.inspect(context));
+
+		context.validate(objects, function (err, job) {
+			if (err) {
+				throw err;
+			}
+			if (job) {
+				report.reportBulk(job.failed, job.passed);
+				if (!job.success) {
+					grunt.log.writeln('');
+				}
+				done(job.success);
+			}
+			else {
+				done(false);
+			}
+		});
+	});
+};
Index: Dev/trunk/package.json
===================================================================
--- Dev/trunk/package.json	(revision 486)
+++ Dev/trunk/package.json	(revision 487)
@@ -18,5 +18,6 @@
     "grunt-amd-check": "~0.5.2",
     "mocha": "~1.14.0",
-    "should": "~2.1.0"
+    "should": "~2.1.0",
+    "grunt-tv4": "^0.4.0"
   },
   "dependencies": {}
Index: Dev/trunk/src/.jshintrc-generated
===================================================================
--- Dev/trunk/src/.jshintrc-generated	(revision 486)
+++ Dev/trunk/src/.jshintrc-generated	(revision 487)
@@ -17,4 +17,5 @@
     "loopfunc": true,
     "shadow": true,
+    "eqnull": true,
 
     "devel": true,
Index: Dev/trunk/src/client/qed-client/app/Router.js
===================================================================
--- Dev/trunk/src/client/qed-client/app/Router.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/app/Router.js	(revision 487)
@@ -78,5 +78,5 @@
                         route.callback(params);
                     } catch(err) {
-                        console.error("Page change failed with",err.toString());
+                        console.error("Page change failed with",err,err.toString());
                     }
                     return;
Index: Dev/trunk/src/client/qed-client/model/classes/Question.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/Question.js	(revision 486)
+++ 	(revision )
@@ -1,20 +1,0 @@
-define(function(){
-    return {
-        create: function(){
-            return { type:'Question' };
-        },
-        DisplayTitle: {
-            get: function(q) {
-                return q.title || '';
-            }
-        },
-        Content: {
-            get: function(q) {
-                return q.content || [];
-            },
-            set: function(q,content) {
-                q.content = content;
-            }
-        }
-    };
-});
Index: Dev/trunk/src/client/qed-client/model/classes/Response.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/Response.js	(revision 486)
+++ 	(revision )
@@ -1,17 +1,0 @@
-define([],function(){
-    var SurveyRun = {
-        create: function(){
-            return { type:'Response' };
-        },
-        SurveyRun: {
-            get: function(r) {
-                return r.surveyRunId || null;
-            },
-            set: function(r,sr) {
-                r.surveyRunId = sr;
-                return r;
-            }
-        }
-    };
-    return SurveyRun;
-});
Index: Dev/trunk/src/client/qed-client/model/classes/SessionTemplate.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/SessionTemplate.js	(revision 486)
+++ 	(revision )
@@ -1,12 +1,0 @@
-define(function(){
-    return {
-        create: function(){
-            return { type:'SessionTemplate' };
-        },
-        DisplayTitle: {
-            get: function(st) {
-                return st.title || '';
-            }
-        }
-    };
-});
Index: Dev/trunk/src/client/qed-client/model/classes/Survey.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/Survey.js	(revision 486)
+++ 	(revision )
@@ -1,20 +1,0 @@
-define(function(){
-    return {
-        create: function(){
-            return { type:'Survey' };
-        },
-        DisplayTitle: {
-            get: function(s) {
-                return s.title || '';
-            }
-        },
-        Questions: {
-            get: function(s) {
-                return s.questions || [];
-            },
-            set: function(s,questions) {
-                s.questions = questions;
-            }
-        }
-    };
-});
Index: Dev/trunk/src/client/qed-client/model/classes/SurveyRun.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/SurveyRun.js	(revision 486)
+++ 	(revision )
@@ -1,57 +1,0 @@
-define(['dojo/_base/lang','dojo/date/locale','dojo/date/stamp'],function(lang,locale,stamp){
-    var SurveyRun = {
-        create: function(){
-            return { type:'SurveyRun' };
-        },
-        StartDate: {
-            get: function(sr) {
-                var d;
-                if ( sr.startDate ) {
-                    d = lang.isString(sr.startDate) ? stamp.fromISOString(sr.startDate) : sr.startDate;
-                }
-                return d;
-            },
-            set: function(sr,d) {
-                if ( d ) {
-                    sr.startDate = lang.isString(d) ? stamp.toISOString(d) : d;
-                }
-            }
-        },
-        EndDate: {
-            get: function(sr) {
-                var d;
-                if ( sr.endDate ) {
-                    d = lang.isString(sr.endDate) ? stamp.fromISOString(sr.endDate) : sr.endDate;
-                }
-                return d;
-            },
-            set: function(sr,d) {
-                if ( d ) {
-                    sr.endDate = lang.isString(d) ? stamp.toISOString(d) : d;
-                }
-            }
-        },
-        DisplayTitle: {
-            get: function(sr) {
-                var t = "Run of '"+sr.survey.title+"'";
-                if ( sr.startDate ) {
-                    t += " from "+locale.format(SurveyRun.StartDate.get(sr));
-                }
-                if ( sr.endDate ) {
-                    t += " until "+locale.format(SurveyRun.EndDate.get(sr));
-                }
-                return t;
-            }
-        },
-        Survey: {
-            get: function(sr) {
-                return sr.survey || null;
-            },
-            set: function(sr,s) {
-                sr.survey = s;
-                return sr;
-            }
-        }
-    };
-    return SurveyRun;
-});
Index: Dev/trunk/src/client/qed-client/model/classes/_Class.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/_Class.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/_Class.js	(revision 487)
@@ -0,0 +1,51 @@
+define([
+    "./_View",
+    "dojo/_base/declare",
+    "dojo/_base/lang"
+], function(_View, declare, lang) {
+
+    var _Class = declare([_View],{
+        _type: null,
+        constructor: function() {
+            if ( this._type === null ) {
+                throw new Error("You must specify a concrete type.");
+            }
+        },
+        create: function() {
+            var obj = {
+                type: this._type
+            };
+            console.warn("You may want to override create for concrete types.");
+            return obj;
+        },
+        _doSerialize: function(obj) {
+            obj = lang.clone(obj);
+            return this._serialize(obj) || obj;
+        },
+        _serialize: function(obj) {
+            console.warn("You may want to override _serialize for concrete types.");
+        },
+        load: function(id) {
+            return this._store.get(id).then(lang.hitch(this,'_doDeserialize'));
+        },
+        save: function(obj) {
+            return this._store.put(this._doSerialize(obj));
+        },
+        remove: function(objOrId,rev) {
+            var id;
+            if ( typeof objOrId === "string" ) {
+                id = objOrId;
+            } else {
+                id = this.getId(objOrId);
+                rev = this.getRev(objOrId);
+            }
+            return this._store.remove(id,{headers:{'If-Match':'"'+rev+'"'}});
+        },
+        getRev: function(obj) {
+            return obj._rev;
+        }
+    });
+
+    return _Class;
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/_View.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/_View.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/_View.js	(revision 487)
@@ -0,0 +1,37 @@
+define([
+    "../../store/JsonRest",
+    "dojo/_base/declare",
+    "dojo/_base/lang",
+    "dojo/store/util/QueryResults"
+], function(JsonRest, declare, lang, queryResults) {
+
+    var _View = declare([],{
+        _collection: null,
+        _store: null,
+        constructor: function() {
+            if ( this._collection === null ) {
+                throw new Error("You must specify a concrete collection.");
+            }
+            this._store = new JsonRest({
+                target: '/api/'+this._collection+'/',
+                idProperty: '_id'
+            });
+        },
+        _doDeserialize: function(obj) {
+            obj = lang.clone(obj);
+            return this._deserialize(obj) || obj;
+        },
+        _deserialize: function(obj) {
+            console.warn("You may want to override _deserialize for concrete types.");
+        },
+        query: function(query) {
+            return queryResults(this._store.query(query).map(lang.hitch(this,'_doDeserialize')));
+        },
+        getId: function(obj) {
+            return obj._id;
+        }
+    });
+
+    return _View;
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/categories.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/categories.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/categories.js	(revision 487)
@@ -0,0 +1,16 @@
+define([
+    "./_View",
+    "dojo/_base/declare"
+], function(_View, declare) {
+
+    var Categories = declare([_View],{
+        _collection: 'categories',
+        _deserialize: function() {},
+        getId: function(obj) {
+            return obj;
+        }
+    });
+
+    return new Categories();
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/questions.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/questions.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/questions.js	(revision 487)
@@ -0,0 +1,34 @@
+define([
+    "./_Class",
+    "dojo/_base/declare",
+    "dojo/date/stamp"
+], function(_Class, declare, stamp) {
+
+    var Questions = declare([_Class],{
+        _collection: 'questions',
+        _type: 'Question',
+        create: function() {
+            var obj = {
+                type: this._type,
+                categories: [],
+                code: "",
+                content: [],
+                title: ""
+            };
+            return obj;
+        },
+        _deserialize: function(obj) {
+            if (obj.publicationDate) {
+                obj.publicationDate = stamp.fromISOString(obj.publicationDate);
+            }
+        },
+        _serialize: function(obj) {
+            if (obj.publicationDate) {
+                obj.publicationDate = stamp.toISOString(obj.publicationDate);
+            }
+        }
+    });
+
+    return new Questions();
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/responses.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/responses.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/responses.js	(revision 487)
@@ -0,0 +1,93 @@
+define([
+    "./_Class",
+    "./surveyRuns",
+    "dojo/Deferred",
+    "dojo/_base/declare",
+    "dojo/_base/json",
+    "dojo/_base/lang",
+    "dojo/_base/xhr",
+    "dojo/date/stamp"
+], function(_Class, surveyRuns, Deferred, declare, json, lang, xhr, stamp) {
+
+    var Responses = declare([_Class],{
+        _collection: 'responses',
+        _type: 'Response',
+        create: function() {
+            var obj = {
+                type: this._type,
+                answers: {},
+                surveyRunId: null
+            };
+            return obj;
+        },
+        _deserialize: function(obj) {
+            if (obj._surveyRun) {
+                obj._surveyRun = surveyRuns._doDeserialize(obj._surveyRun);
+            }
+            if (obj.publicationDate) {
+                obj.publicationDate = stamp.fromISOString(obj.publicationDate);
+            }
+        },
+        _serialize: function(obj) {
+            if (obj._surveyRun) {
+                obj._surveyRun = surveyRuns._doSerialize(obj._surveyRun);
+            }
+            if (obj.publicationDate) {
+                obj.publicationDate = stamp.toISOString(obj.publicationDate);
+            }
+        },
+        getWithSecret: function(id,secret) {
+            var query = xhr.objectToQuery({secret:secret});
+            return xhr('GET',{
+                url: '/api/open/responses/' + id + '?' + query,
+                handleAs: 'json',
+                contentType: false
+            }).then(lang.hitch(this,'_doDeserialize'),function(err){
+                return new Deferred().reject(json.fromJson(err.responseText));
+            });
+        },
+        postWithSecret: function(response,secret) {
+            var query = xhr.objectToQuery({secret:secret});
+            var body = json.toJson(this._doSerialize(response));
+            return xhr('POST',{
+                url: '/api/open/responses?' + query,
+                handleAs: 'json',
+                contentType: 'application/json',
+                rawBody: body
+            }).then(lang.hitch(this,'_doDeserialize'),function(err){
+                return new Deferred().reject(json.fromJson(err.responseText));
+            });
+        },
+        putWithSecret: function(response,secret) {
+            var query = xhr.objectToQuery({secret:secret});
+            var body = json.toJson(this._doSerialize(response));
+            return xhr('PUT',{
+                url: '/api/open/responses/' + this.getId(response) + '?' + query,
+                handleAs: 'json',
+                contentType: 'application/json',
+                rawBody: body
+            }).then(lang.hitch(this,'_doDeserialize'),function(err){
+                return new Deferred().reject(json.fromJson(err.responseText));
+            });
+        },
+        removeWithSecret: function(response,secret) {
+            var query = xhr.objectToQuery({secret:secret});
+            var rev = this.getRev(response);
+            var body = json.toJson(this._doSerialize(response));
+            var headers = {};
+            if ( rev ) {
+                headers['If-Match'] = '"'+rev+'"';
+            }
+            return xhr('DELETE',{
+                url: '/api/open/responses/' + this.getId(response) + '?' + query,
+                headers: headers,
+                handleAs: 'json',
+                contentType: 'application/json',
+                rawBody: body
+            });
+        }
+    });
+
+    return new Responses();
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/surveyRuns.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/surveyRuns.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/surveyRuns.js	(revision 487)
@@ -0,0 +1,47 @@
+define([
+    "./_Class",
+    "./surveys",
+    "dojo/_base/declare",
+    "dojo/date/stamp"
+], function(_Class, surveys, declare, stamp) {
+
+    var SurveyRuns = declare([_Class],{
+        _collection: 'surveyRuns',
+        _type: 'SurveyRun',
+        create: function() {
+            var obj = {
+                type: this._type,
+                description: "",
+                mode: "open",
+                survey: null,
+                title: ""
+            };
+            return obj;
+        },
+        _deserialize: function(obj) {
+            if (obj.endDate) {
+                obj.endDate = stamp.fromISOString(obj.endDate);
+            }
+            if (obj.startDate) {
+                obj.startDate = stamp.fromISOString(obj.startDate);
+            }
+            if (obj.survey) {
+                obj.survey = surveys._doDeserialize(obj.survey);
+            }
+        },
+        _serialize: function(obj) {
+            if (obj.endDate) {
+                obj.endDate = stamp.toISOString(obj.endDate);
+            }
+            if (obj.startDate) {
+                obj.startDate = stamp.toISOString(obj.startDate);
+            }
+            if (obj.survey) {
+                obj.survey = surveys._doSerialize(obj.survey);
+            }
+        }
+    });
+
+    return new SurveyRuns();
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/surveys.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/surveys.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/surveys.js	(revision 487)
@@ -0,0 +1,33 @@
+define([
+    "./_Class",
+    "dojo/_base/declare",
+    "dojo/date/stamp",
+    "dojo/store/JsonRest"
+], function(_Class, declare, stamp, JsonRest) {
+
+    var Surveys = declare([_Class],{
+        _collection: 'surveys',
+        _type: 'Survey',
+        create: function() {
+            var obj = {
+                type: this._type,
+                questions: [],
+                title: ""
+            };
+            return obj;
+        },
+        _deserialize: function(obj) {
+            if (obj.publicationDate) {
+                obj.publicationDate = stamp.fromISOString(obj.publicationDate);
+            }
+        },
+        _serialize: function(obj) {
+            if (obj.publicationDate) {
+                obj.publicationDate = stamp.toISOString(obj.publicationDate);
+            }
+        }
+    });
+
+    return new Surveys();
+
+});
Index: Dev/trunk/src/client/qed-client/model/classes/topics.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/classes/topics.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/model/classes/topics.js	(revision 487)
@@ -0,0 +1,16 @@
+define([
+    "./_View",
+    "dojo/_base/declare"
+], function(_View, declare) {
+
+    var Topics = declare([_View],{
+        _collection: 'topics',
+        _deserialize: function() {},
+        getId: function(obj) {
+            return obj;
+        }
+    });
+
+    return new Topics();
+
+});
Index: Dev/trunk/src/client/qed-client/model/schema.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/schema.js	(revision 486)
+++ 	(revision )
@@ -1,157 +1,0 @@
-define(['dojo/_base/lang'],function(lang){
-
-    /** Note on dojox.json.schema
-     * This implementation is not according to the version 03 of the json-schema
-     * draft. Differences:
-     * - doesn't support the 'required' property, but uses 'optional' (which is
-     *   false by default).
-     */
-
-    ////////////////////////////////////////
-    // Base schema types
-    //
-
-    var dateRe = "\\d{4}-\\d{2}-\\d{2}"; // YYYY-MM-DD
-    var timeRe = "\\d{2}:\\d{2}:\\d{2}"; // hh:mm:ss 
-    var datetimeRe = dateRe+"T"+timeRe+"Z"; // YYYY-MM-DDThh:mm:ssZ
-
-    function mixin(obj1,obj2) {
-        return lang.mixin({},obj1||{},obj2||{});
-    }
-    function mkType(base) {
-        return function(props) {
-            return mixin(base,props);
-        };
-    }
-
-    var nestring = mkType({ type:'string', minLength:1 });
-    var string = mkType({ type:'string' });
-    var integer = mkType({ type: 'integer' });
-    var bool = mkType({ type: 'boolean' });
-    var pattern = function(p){
-        return mixin({
-            type: 'string',
-            pattern: p
-        });
-    };
-    var date = mkType(pattern(dateRe));
-    var time = mkType(pattern(timeRe));
-    var datetime = mkType(pattern(datetimeRe));
-    var array = function(items,props) {
-        return mixin({
-            type: 'array',
-            items: items
-        },props);
-    };
-    var object = function(properties,props) {
-        return mixin({
-            type: 'object',
-            properties: properties,
-            additionalProperties: false
-        },props);
-    };
-    var optional = mkType({ optional: true });
-
-    ////////////////////////////////////////
-    // Domain specific
-    //
-
-    var typedobject = function(type,properties,props) {
-        return object(mixin(properties,{
-            type: pattern(type)
-        }),props);
-    };
-
-    var dbobject = function(type,properties,props) {
-        return typedobject(type,mixin(properties,{
-            _id: nestring(optional()),
-            _rev: nestring(optional())
-        }),props);
-    };
-
-    ////////////////////////////////////////
-    // The QED schema
-    //
-
-    var Respondent = dbobject('Respondent',{
-        secret: nestring()
-    });
-
-    var Question = dbobject('Question',{
-        code:nestring(),
-        title: nestring(),
-        description: string(optional()),
-        topic: string(optional()),
-        categories: array(nestring(),optional()),
-        content: array([
-            typedobject('Header',{
-                content:string(optional())
-            }),
-            typedobject('Text',{
-                content:string(optional())
-            }),
-            typedobject('Divider'),
-            typedobject('StringInput'),
-            typedobject('TextInput',{
-                maxLength:integer()
-            }),
-            typedobject('IntegerInput',{
-                min:integer(),
-                max:integer(),
-                step:integer()
-            }),
-            typedobject('MultipleChoiceInput',{
-                multiple:bool(),
-                items:array(nestring())
-            })
-        ],optional()),
-        publicationDate:datetime(optional())
-    });
-
-    var Survey = dbobject('Survey',{
-        title: nestring(),
-        description: string(optional()),
-        questions: array(Question,optional()),
-        publicationDate:datetime(optional())
-    });
-
-    var SurveyRun = dbobject('SurveyRun',{
-        description: string(optional()),
-        survey: Survey,
-        publicationDate:datetime(optional()),
-        startDate:datetime(optional()),
-        endDate:datetime(optional()),
-        mode:{type:'string','enum':['open','closed'],optional:true},
-        metadata:string(optional())
-    });
-
-    var Response = dbobject('Response',{
-        surveyRunId: nestring(),
-        answers:{type:'object',optional:true},
-        publicationDate:datetime(optional())
-    });
-
-    var Session = dbobject('Session',{
-        title: nestring(),
-        description: string(optional()),
-        publicationDate: datetime(optional())
-    });
-
-    var SessionTemplate = dbobject('SessionTemplate',{
-        title: nestring(),
-        description: string(optional()),
-        publicationDate: datetime(optional()),
-        plannedDate: datetime(optional())
-    });
-
-    var schema = {type:[
-        Question,
-        Survey,
-        SurveyRun,
-        Response,
-        Session,
-        SessionTemplate
-    ]};
-
-    return schema;
-});
Index: Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorToolkit.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorToolkit.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorToolkit.js	(revision 487)
@@ -1,4 +1,5 @@
 define([
-    "../../store",
+    "../classes/categories",
+    "../classes/topics",
     "./CategoryListView",
     "dijit/_Container",
@@ -15,5 +16,5 @@
     "require",
     "dojo/text!./templates/QuestionEditorToolkit.html"
-], function(store, CategoryListView, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, declare, lang, Source, domConstruct, Memory, require, template) {
+], function(categories, topics, CategoryListView, _Container, _TemplatedMixin, _WidgetBase, _WidgetsInTemplateMixin, Button, ComboBox, declare, lang, Source, domConstruct, Memory, require, template) {
     return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin, _Container], {
 
@@ -107,12 +108,10 @@
             this.inherited(arguments);
 
-            store.query("_design/questions/_view/all", {reduce:true, group:false, group_level:1})
-            .forPairs(lang.hitch(this, function(value, key) {
-                this._categoryStore.put({ id: key[0] });
+            categories.query().forEach(lang.hitch(this,function(cat){
+                this._categoryStore.put({ id: cat });
             }));
 
-            store.query("_design/questions/_view/all_topics", {reduce:true, group:true})
-            .forPairs(lang.hitch(this, function(value, key) {
-                this._topicStore.put({ id: key });
+            topics.query().forEach(lang.hitch(this,function(topic){
+                this._categoryStore.put({ id: topic });
             }));
         },
Index: Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/model/widgets/SurveyRenderWidget.js	(revision 487)
@@ -1,5 +1,4 @@
 define([
     "../../widgets/_ComplexValueWidget",
-    "../classes/Survey",
     "./questions/Factory",
     "dojo/_base/array",
@@ -7,5 +6,5 @@
     "dojo/dom-construct",
     "dojo/text!./templates/SurveyRenderWidget.html"
-], function(_ComplexValueWidget, Survey, QuestionWidgetFactory, array, declare, domConstruct, template) {
+], function(_ComplexValueWidget, QuestionWidgetFactory, array, declare, domConstruct, template) {
     return declare([_ComplexValueWidget],{
         templateString: template,
@@ -22,5 +21,5 @@
             this.survey = survey;
             var f = new QuestionWidgetFactory();
-            array.forEach(Survey.Questions.get(this.survey),function(question,question_index){
+            array.forEach(this.survey.questions,function(question,question_index){
                 array.forEach(question.content || [], function(item,item_index){
                     // The dot causes values to be grouped in an object!
Index: Dev/trunk/src/client/qed-client/model/widgets/SurveySummary.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/SurveySummary.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/model/widgets/SurveySummary.js	(revision 487)
@@ -1,5 +1,3 @@
 define([
-    "../../store",
-    "../classes/Survey",
     "dijit/_TemplatedMixin",
     "dijit/_WidgetBase",
@@ -7,5 +5,5 @@
     "dojo/dom-attr",
     "dojo/text!./templates/SurveySummary.html"
-], function(store, Survey, _TemplatedMixin, _WidgetBase, declare, domAttr, template) {
+], function(_TemplatedMixin, _WidgetBase, declare, domAttr, template) {
     return declare([_WidgetBase,_TemplatedMixin],{
         templateString: template,
@@ -18,9 +16,8 @@
         },
         _setValueAttr: function(survey) {
-            this.titleNode.innerHTML = Survey.DisplayTitle.get(survey);
-            var id = store.getIdentity(survey);
-            domAttr.set(this.titleNode, "href", id && ("#!/survey/"+id));
+            this.titleNode.innerHTML = survey.title || "";
+            domAttr.set(this.titleNode, "href", survey._id && ("#!/survey/"+survey._id));
             this.descriptionNode.innerHTML = survey.description;
-            this.questionsNode.innerHTML = (survey.questions || []).length;
+            this.questionsNode.innerHTML = survey.questions.length;
         }
     });
Index: Dev/trunk/src/client/qed-client/model/widgets/TabbedQuestionBrowser.js
===================================================================
--- Dev/trunk/src/client/qed-client/model/widgets/TabbedQuestionBrowser.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/model/widgets/TabbedQuestionBrowser.js	(revision 487)
@@ -1,12 +1,14 @@
 define([
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/_base/window',
-    'dijit/layout/ContentPane',
-    'dijit/layout/TabContainer',
-    'dojox/widget/Standby',
-    '../../store',
-    '../../widgets/Selector'
-],function(declare,lang,win,ContentPane,TabContainer,Standby,store,Selector){
+    "../../widgets/Selector",
+    "../classes/categories",
+    "../classes/questions",
+    "../classes/topics",
+    "dijit/layout/ContentPane",
+    "dijit/layout/TabContainer",
+    "dojo/_base/declare",
+    "dojo/_base/lang",
+    "dojo/_base/window",
+    "dojox/widget/Standby"
+], function(Selector, categories, questions, topics, ContentPane, TabContainer, declare, lang, win, Standby) {
     return declare([TabContainer],{
         tabPosition: 'left-h',
@@ -38,7 +40,7 @@
                 this._fillCategoryTab(newTab.__category);
             }));
-            store.query(this._query, {reduce:true,group:true,group_level:1})
-            .forPairs(lang.hitch(this,function(value,key){
-                this._createCategoryTab(key[0],value);
+            categories.query()
+            .forEach(lang.hitch(this,function(cat){
+                this._createCategoryTab(cat.name,cat.count);
             }));
         },
@@ -61,7 +63,7 @@
                 this._busy();
                 categoryMap._filled = true;
-                store.query(this._query, {reduce:true,group:true,group_level:2,startkey:[category],endkey:[category,{}]})
-                .forPairs(lang.hitch(this,function(value,key){
-                    this._createTopicSelector(key[1],category,value);
+                topics.query({category:category})
+                .forEach(lang.hitch(this,function(topic){
+                    this._createTopicSelector(topic.name,category,topic.count);
                 })).then(lang.hitch(this,function(){
                     this._done();
@@ -101,9 +103,6 @@
                 topicMap._filled = true;
                 this._busy();
-                store.query(this._query, {
-                    reduce:false,
-                    include_docs:true,
-                    key:[category,topic]
-                }).forEach(lang.hitch(this,function(value){
+                questions.query({category:category,topic:topic})
+                .forEach(lang.hitch(this,function(value){
                     topicMap._widget.addItem(value);
                 })).then(lang.hitch(this,function(){
Index: Dev/trunk/src/client/qed-client/pages/previewSurvey.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/previewSurvey.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/previewSurvey.js	(revision 487)
@@ -1,5 +1,5 @@
 define([
     "../app/Page",
-    "../store",
+    "../model/classes/surveys",
     "dojo/_base/array",
     "dojo/_base/declare",
@@ -8,5 +8,5 @@
     "require",
     "dojo/text!./templates/previewSurvey.html"
-], function(Page, store, array, declare, lang, when, require, template) {
+], function(Page, surveys, array, declare, lang, when, require, template) {
     return declare([Page],{
         contextRequire: require,
@@ -16,7 +16,7 @@
             this.inherited(arguments);
             if ( this.surveyId ) {
-                when(store.get(this.surveyId))
+                when(surveys.load(this.surveyId))
                 .then(lang.hitch(this,function(survey){
-                    this.titleNode.innerHTML = survey.title;
+                    this.titleNode.innerHTML = survey.title || "";
                     this.surveyWidget.set('survey',survey);
                 }));
Index: Dev/trunk/src/client/qed-client/pages/question.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/question.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/question.js	(revision 487)
@@ -3,8 +3,7 @@
     "../app/Page",
     "../app/Router",
-    "../model/classes/Question",
+    "../model/classes/questions",
     "../model/widgets/QuestionEditorPreview",
     "../model/widgets/QuestionEditorToolkit",
-    "../store",
     "../widgets/_ComplexValueMixin",
     "dojo/_base/declare",
@@ -13,5 +12,5 @@
     "dojo/when",
     "dojo/text!./templates/question.html"
-], function(Content, Page, Router, Question, QuestionEditorPreview, QuestionEditorToolkit, store, _ComplexValueMixin, declare, event, lang, when, template) {
+], function(Content, Page, Router, questions, QuestionEditorPreview, QuestionEditorToolkit, _ComplexValueMixin, declare, event, lang, when, template) {
     return declare([Page,_ComplexValueMixin], {
         templateString: template,
@@ -43,7 +42,7 @@
             }
             if (this.questionId === "new") {
-                this.set('value', Question.create());
+                this.set('value', questions.create());
             } else {
-                when(store.get(this.questionId))
+                when(questions.load(this.questionId))
                 .then(lang.hitch(this, function(value) {
                     this.set('value', value);
@@ -54,5 +53,5 @@
             this.value = value;
             this.inherited(arguments);
-            this.titleNode.innerHTML = Question.DisplayTitle.get(value);
+            this.titleNode.innerHTML = value.title || "";
         },
         _getValueAttr: function() {
@@ -63,6 +62,5 @@
         _onSave: function(evt) {
             if ( this.validate() ) {
-                var value = this.get('value');
-                store.put(value)
+                questions.save(this.get('value'))
                 .then(function() {
                     Router.go('/questions');
Index: Dev/trunk/src/client/qed-client/pages/questions.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/questions.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/questions.js	(revision 487)
@@ -1,14 +1,14 @@
 define([
-    'dojo/_base/declare',
-    'dojo/_base/Deferred',
-    'dojo/_base/event',
-    'dojo/_base/lang',
-    '../store',
-    '../app/Content',
-    '../app/Router',
-    '../app/Page',
-    '../model/widgets/TabbedQuestionBrowser',
-    'dojo/text!./templates/questions.html'
-],function(declare,Deferred,event,lang,store,Content,Router,Page,TabbedQuestionBrowser,template) {
+    "../app/Content",
+    "../app/Page",
+    "../app/Router",
+    "../model/classes/questions",
+    "../model/widgets/TabbedQuestionBrowser",
+    "dojo/_base/Deferred",
+    "dojo/_base/declare",
+    "dojo/_base/event",
+    "dojo/_base/lang",
+    "dojo/text!./templates/questions.html"
+], function(Content, Page, Router, questions, TabbedQuestionBrowser, Deferred, declare, event, lang, template) {
     return declare([Page],{
         templateString: template,
@@ -44,5 +44,5 @@
         },
         onDeleteQuestion: function(question) {
-            store.remove(store.getIdentity(question),store.getRevision(question))
+            questions.remove(question)
             .then(function(){
                 Content.notify("Question deleted.");
@@ -55,6 +55,6 @@
         },
         onPublishQuestion: function(question) {
-            question.publicationDate = store.timestamp();
-            store.put(question)
+            question.publicationDate = new Date();
+            questions.save(question)
             .then(function(){
                 Content.notify("Question published.");
Index: Dev/trunk/src/client/qed-client/pages/response.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/response.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/response.js	(revision 487)
@@ -3,8 +3,5 @@
     "../app/Page",
     "../lib/async",
-    "../model/classes/Response",
-    "../model/classes/Survey",
-    "../model/classes/SurveyRun",
-    "../store",
+    "../model/classes/responses",
     "dojo/_base/declare",
     "dojo/_base/event",
@@ -16,5 +13,5 @@
     "require",
     "dojo/text!./templates/response.html"
-], function(Content, Page, async, Response, Survey, SurveyRun, store, declare, event, json, lang, all, request, when, require, template) {
+], function(Content, Page, async, responses, declare, event, json, lang, all, request, when, require, template) {
     return declare([Page],{
         contextRequire: require,
@@ -28,35 +25,17 @@
             this.inherited(arguments);
             this._disableSubmit();
-            var surveyRunId = this.surveyRunId;
-            var responseId = this.options && this.options.id;
-            if ( surveyRunId && responseId ) {
-                this._loadSurveyAndResponse(surveyRunId,responseId)
-                .then(lang.hitch(this, function() {
-                    if ( this.response.publicationDate ) {
-                        this._showInfo("<div>You already submitted your survey and cannot change it anymore. You can still view your answers here.</div>");
-                        this._disableSubmit();
-                    } else {
-                        this._enableSubmit();
-                    }
-                }), lang.hitch(this,function() {
-                    this._showInfo("<div>The url seems to be incorrect, no survey found.</div>");
-                }));
+            if ( !this.response ) {
+                this._showInfo("<div>The url seems to be incorrect, no response found.</div>");
             } else {
-                throw new Error("No valid uid or survey passed!");
+                this.titleNode.innerHTML = this.response._surveyRun.survey.title || "";
+                this.surveyWidget.set('survey', this.response._surveyRun.survey);
+                this.surveyWidget.set('value', this.response.answers || {});
+                if ( this.response.publicationDate ) {
+                    this._showInfo("<div>You already submitted your survey and cannot change it anymore. You can still view your answers here.</div>");
+                    this._disableSubmit();
+                } else {
+                    this._enableSubmit();
+                }
             }
-        },
-        _loadSurveyAndResponse: function(surveyRunId,responseId){
-            return all([request.get('/api/surveyRuns/'+surveyRunId,{handleAs:'json'}),
-                        request.get('/api/responses/'+responseId,{handleAs:'json'})])
-            .then(lang.hitch(this,function(surveyAndResponse){
-                var surveyRun = surveyAndResponse[0];
-                this.response = surveyAndResponse[1];
-                if ( this.response.surveyRunId !== surveyRunId ) {
-                    throw "Survey does not match the response...";
-                }
-                this.titleNode.innerHTML = Survey.DisplayTitle.get(surveyRun.survey);
-                this.surveyWidget.set('survey', surveyRun.survey);
-                this.surveyWidget.set('value', this.response.answers || {});
-            }));
         },
         _enableSubmit: function() {
@@ -78,10 +57,7 @@
             var answers = this.surveyWidget.get('value');
             this.response.answers = answers;
-            return request.put('/api/responses/'+store.getIdentity(this.response),{
-                handleAs:'json',
-                data:json.toJson(this.response),
-                headers:{"Content-Type": "application/json"}
-            }).then(lang.hitch(this,function(res){
-                this.response._rev = res.rev;
+            return responses.putWithSecret(this.response,this.response.secret)
+            .then(lang.hitch(this,function(response){
+                this.response = response;
                 Content.notify("Your response is saved.");
             }), function(err){
@@ -90,5 +66,5 @@
         },
         _onSubmit: function(e) {
-            this.response.publicationDate = store.timestamp();
+            this.response.publicationDate = new Date();
             this._getAnswersAndSaveResponse()
             .then(lang.hitch(this,function(){
@@ -110,10 +86,6 @@
             this._disableSubmit();
             this.surveyWidget.destroy();
-            request('/api/responses/'+store.getIdentity(this.response)+'?rev='+store.getRevision(this.response),{
-                method: 'DELETE',
-                handleAs:'json',
-                data:json.toJson(this.response),
-                headers:{"Content-Type": "application/json"}
-            }).then(lang.hitch(this,function(res){
+            responses.removeWithSecret(this.response,this.response.secret)
+            .then(lang.hitch(this,function(res){
                 this._showInfo("<div>Your response has been deleted, no answers have been saved.</div>");
                 Content.notify("Your response is deleted.");
Index: Dev/trunk/src/client/qed-client/pages/session.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/session.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/session.js	(revision 487)
@@ -1,4 +1,4 @@
 define([
-    'dojo/_base/array',
+    /*'dojo/_base/array',
     'dojo/_base/declare',
     'dojo/_base/event',
@@ -12,7 +12,7 @@
     '../model/classes/SessionTemplate',
     '../model/widgets/AccountListView',
-    'dojo/text!./templates/session.html'
+    'dojo/text!./templates/session.html'*/
 ],function(array,declare,event,lang,when,search,store,Page,Router,ThresholdFilteringSelect,SessionTemplate,AccountListView,template){
-    return declare([Page],{
+    /*return declare([Page],{
         templateString: template,
         session: null,
@@ -92,5 +92,5 @@
 
 
-    });
+    });*/
 });
 
Index: Dev/trunk/src/client/qed-client/pages/sessions.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/sessions.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/sessions.js	(revision 487)
@@ -1,4 +1,4 @@
 define([
-    'dojo/_base/declare',
+    /*'dojo/_base/declare',
     'dojo/_base/lang',
     'dojo/date/stamp',
@@ -7,7 +7,7 @@
     '../app/Page',
     '../widgets/ObjectBox',
-    'dojo/text!./templates/sessions.html'
+    'dojo/text!./templates/sessions.html'*/
 ],function(declare,lang,dateStamp,store,Router,Page,ObjectBox,template){
-    return declare([Page],{
+    /*return declare([Page],{
         templateString: template,
         templateActions: null,
@@ -18,8 +18,8 @@
             this.templateActions = {
                 "Edit": function(obj){
-                    Router.go('/session/'+store.getIdentity(obj));
+                    Router.go('/session/'+obj.get('id'));
                 },
                 "Delete": lang.hitch(this,function(obj){
-                    store.remove(store.getIdentity(obj),store.getRevision(obj))
+                    obj.remove()
                     .then(lang.hitch(this,function(){
                         this._refresh();
@@ -30,8 +30,8 @@
             this.sessionActions = {
                 "Facilitate": function(obj){
-                    Router.go('run',{uid:store.getIdentity(obj)});
+                    Router.go('run',{uid: obj.get('id')});
                 },
                 "Delete": lang.hitch(this,function(obj){
-                    store.remove(store.getIdentity(obj),store.getRevision(obj))
+                    obj.remove()
                     .then(lang.hitch(this,function(){
                         this._refresh();
@@ -48,4 +48,5 @@
         },
         _refreshByType: function(type,container,actions) {
+            // FIXME
             store.query("_design/default/_view/by_type",{key:type})
             .forEach(lang.hitch(this,function(obj){
@@ -61,4 +62,5 @@
         },
         _publishSession: function(sessionTemplate) {
+            // FIXME
             var session = lang.clone(sessionTemplate);
             delete session[store.idProperty];
@@ -73,4 +75,4 @@
             }));
         }
-    });
+    });*/
 });
Index: Dev/trunk/src/client/qed-client/pages/survey.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/survey.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/survey.js	(revision 487)
@@ -2,8 +2,7 @@
     "../app/Page",
     "../app/Router",
-    "../model/classes/Survey",
+    "../model/classes/surveys",
     "../model/widgets/QuestionListView",
     "../model/widgets/TabbedQuestionBrowser",
-    "../store",
     "dojo/_base/array",
     "dojo/_base/declare",
@@ -13,5 +12,5 @@
     "require",
     "dojo/text!./templates/survey.html"
-], function(Page, Router, Survey, QuestionListView, TabbedQuestionBrowser, store, array, declare, event, lang, when, require, template) {
+], function(Page, Router, surveys, QuestionListView, TabbedQuestionBrowser, array, declare, event, lang, when, require, template) {
     return declare([Page],{
         contextRequire: require,
@@ -63,12 +62,12 @@
         _loadSurvey: function() {
             if ( this.surveyId === "new" ) {
-                this.survey = Survey.create();
+                this.survey = surveys.create();
                 this.refresh();
             } else {
-                when(store.get(this.surveyId))
+                when(surveys.load(this.surveyId))
                 .then(lang.hitch(this,function(survey){
                     this.survey = survey;
                     this.questionList.set('value',
-                                          Survey.Questions.get(this.survey));
+                                          this.survey.questions);
                     this.refresh();
                 }));
@@ -79,5 +78,5 @@
         },
         refresh: function() {
-            this.titleNode.innerHTML = Survey.DisplayTitle.get(this.survey) || "(set title in properties)";
+            this.titleNode.innerHTML = this.survey.title || "(set title in properties)";
             this.propertiesDialog.set('value',this.survey);
         },
@@ -100,5 +99,5 @@
         _onSave: function(evt) {
             this.survey.questions = this.questionList.get('value');
-            store.put(this.survey)
+            surveys.save(this.survey)
             .then(function() { 
                 Router.go('/surveys');
@@ -111,5 +110,5 @@
         },
         _onShowPreview: function() {
-            Router.go('/previewSurvey/'+store.getIdentity(this.survey),{
+            Router.go('/previewSurvey/'+this.survey._id,{
                 preview: true
             });
Index: Dev/trunk/src/client/qed-client/pages/surveyRun.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/surveyRun.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/surveyRun.js	(revision 487)
@@ -4,7 +4,8 @@
     "../app/Router",
     "../lib/func",
-    "../model/classes/SurveyRun",
-    "../store",
+    "../model/classes/responses",
+    "../model/classes/surveyRuns",
     "../widgets/LineWithActionsWidget",
+    "dojo/_base/array",
     "dojo/_base/declare",
     "dojo/_base/event",
@@ -13,5 +14,5 @@
     "require",
     "dojo/text!./templates/surveyRun.html"
-], function(Content, Page, Router, func, SurveyRun, store, LineWithActionsWidget, declare, event, lang, when, require, template) {
+], function(Content, Page, Router, func, responses, surveyRuns, LineWithActionsWidget, array, declare, event, lang, when, require, template) {
     return declare([Page],{
         contextRequire: require,
@@ -24,5 +25,4 @@
             if ( this.surveyRunId ) {
                 this._loadSurveyRun();
-                this._loadResponses();
             } else {
                 throw "No valid uid or survey passed!";
@@ -30,41 +30,44 @@
         },
         _loadSurveyRun: function() {
-            when(store.get(this.surveyRunId))
+            when(surveyRuns.load(this.surveyRunId))
             .then(lang.hitch(this,function(surveyRun){
                 this.surveyRun = surveyRun;
                 this.refreshSurveyRun();
+                this._loadResponses();
             }));
         },
         refreshSurveyRun: function() {
-            this.titleNode.innerHTML = SurveyRun.DisplayTitle.get(this.surveyRun);
-            this.surveySummaryWidget.set('value',SurveyRun.Survey.get(this.surveyRun));
+            this.titleNode.innerHTML = this.surveyRun.title || "";
+            this.surveySummaryWidget.set('value',this.surveyRun.survey);
             this.surveyRunWidget.set('value',this.surveyRun);
             this._onPropChange();
         },
         _loadResponses: function() {
-            when(store.query("_design/responses/_view/by_surveyrun",{key:this.surveyRunId}))
-            .forEach(lang.hitch(this,function(response){
-                var actions = {
-                    view: {
-                        callback: function(){},
-                        properties: {
-                            title: "View response"
-                        }
-                    }
-                };
-                if ( !response.publicationDate ) {
-                    actions.remove = {
-                        callback: function(){},
-                        properties: {
-                            title: "Remove response"
+            responses.query({surveyRunId:surveyRuns.getId(this.surveyRun)})
+            .then(lang.hitch(this,function(allResponses){
+                array.forEach(allResponses, function(response){
+                    var actions = {
+                        view: {
+                            callback: function(){},
+                            properties: {
+                                title: "View response"
+                            }
                         }
                     };
-                }
-                var w = new LineWithActionsWidget({
-                    actions: actions
-                });
-                var responseId = store.getIdentity(response);
-                w.set('title',this._link(this._getResponseURL(this.surveyRunId,responseId),responseId));
-                w.placeAt(this.responsesNode);
+                    if ( !response.publicationDate ) {
+                        actions.remove = {
+                            callback: function(){},
+                            properties: {
+                                title: "Remove response"
+                            }
+                        };
+                    }
+                    var w = new LineWithActionsWidget({
+                        actions: actions
+                    });
+                    var rid = responses.getId(response);
+                    w.set('title',this._link(this._buildResponseURL(response),rid),rid);
+                    w.placeAt(this.responsesNode);
+                }, this);
             }));
         },
@@ -73,5 +76,5 @@
             if ( surveyRun.mode === "open" ) {
                 this.runURLNode.innerHTML =
-                    this._link(this._getGeneralURL(store.getIdentity(this.surveyRun)));
+                    this._link(this._buildGeneralURL(this.surveyRun));
             } else {
                 this.runURLNode.innerHTML =
@@ -79,9 +82,9 @@
             }
         },
-        _getGeneralURL: function(surveyRunId) {
-            return 'response.html#!/'+surveyRunId;
+        _buildGeneralURL: function(surveyRun) {
+            return 'response.html#!/surveyRuns/'+surveyRuns.getId(surveyRun)+'!secret='+surveyRun.secret;
         },
-        _getResponseURL: function(surveyRunId,responseId) {
-            return 'response.html#!/'+surveyRunId+'!id='+responseId;
+        _buildResponseURL: function(response) {
+            return 'response.html#!/responses/'+responses.getId(response)+'!secret='+response.secret;
         },
         _link: function(url,label) {
@@ -92,10 +95,5 @@
                 lang.mixin(this.surveyRun,this.surveyRunWidget.get('value'));
 
-                var SD = SurveyRun.StartDate;
-                var ED = SurveyRun.EndDate;
-                SD.set(this.surveyRun, SD.get(this.surveyRun));
-                ED.set(this.surveyRun, ED.get(this.surveyRun));
-
-                store.put(this.surveyRun)
+                surveyRuns.save(this.surveyRun)
                 .then(function() { 
                     Router.go('/surveys');
Index: Dev/trunk/src/client/qed-client/pages/surveys.js
===================================================================
--- Dev/trunk/src/client/qed-client/pages/surveys.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/pages/surveys.js	(revision 487)
@@ -1,16 +1,15 @@
 define([
-    'dojo/_base/array',
-    'dojo/_base/declare',
-    'dojo/_base/lang',
-    'dojo/when',
-    '../store',
-    '../app/Content',
-    '../app/Page',
-    '../app/Router',
-    '../model/classes/Survey',
-    '../model/classes/SurveyRun',
-    '../widgets/LineWithActionsWidget',
-    'dojo/text!./templates/surveys.html'
-],function(array,declare,lang,when,store,Content,Page,Router,Survey,SurveyRun,LineWithActionsWidget,template){
+    "../app/Content",
+    "../app/Page",
+    "../app/Router",
+    "../model/classes/surveys",
+    "../model/classes/surveyRuns",
+    "../widgets/LineWithActionsWidget",
+    "dojo/_base/array",
+    "dojo/_base/declare",
+    "dojo/_base/lang",
+    "dojo/when",
+    "dojo/text!./templates/surveys.html"
+], function(Content, Page, Router, surveys, surveyRuns, LineWithActionsWidget, array, declare, lang, when, template) {
     return declare([Page],{
         templateString: template,
@@ -25,6 +24,7 @@
         _onPublishSurvey:function(survey){
             var self = this;
-            survey.publicationDate = store.timestamp();
-            store.put(survey).then(function(){
+            survey.publicationDate = new Date();
+            surveys.save(survey)
+            .then(function(){
                 self.refreshDrafts();
                 self.refreshPublished();
@@ -35,5 +35,5 @@
         _onDeleteSurvey:function(survey){
             var self = this;
-            store.remove(store.getIdentity(survey),store.getRevision(survey))
+            surveys.remove(survey)
             .then(function(){
                 self.refreshDrafts();
@@ -43,13 +43,13 @@
         },
         _onEditSurvey:function(survey){
-            Router.go('/survey/'+store.getIdentity(survey));
+            Router.go('/survey/'+survey._id);
         },
         _onPreviewSurvey:function(survey){
-            Router.go('/previewSurvey/'+store.getIdentity(survey));
+            Router.go('/previewSurvey/'+survey._id);
         },
         _onRunSurvey:function(survey){
-            var surveyRun = SurveyRun.create();
-            SurveyRun.Survey.set(surveyRun,survey);
-            store.put(surveyRun)
+            var surveyRun = surveyRuns.create();
+            surveyRun.survey = survey;
+            surveyRuns.save(surveyRun)
             .then(lang.hitch(this,function(surveyRun){
                 this._onRunDetails(surveyRun);
@@ -59,5 +59,5 @@
         },
         _onRunDetails: function(surveyRun) {
-            Router.go('/surveyRun/'+store.getIdentity(surveyRun));
+            Router.go('/surveyRun/'+surveyRun._id);
         },
         refresh: function() {
@@ -68,10 +68,9 @@
         refreshDrafts: function() {
             this.draftsContainer.set('content','');
-            when(store.query("_design/surveys/_view/drafts"),
-                    lang.hitch(this,function(surveys) {
+            when(surveys.query({drafts:true}), lang.hitch(this,function(surveys) {
                 this.draftsTab.set('title','Drafts ('+surveys.length+')');
                 array.forEach(surveys,function(survey){
                     var w = new LineWithActionsWidget({
-                        title: Survey.DisplayTitle.get(survey) || '(unnamed)',
+                        title: survey.title || '(unnamed)',
                         actions: [{
                             callback: lang.hitch(this,'_onPublishSurvey',survey),
@@ -110,10 +109,9 @@
         refreshPublished: function() {
             this.publishedContainer.set('content','');
-            when(store.query("_design/surveys/_view/published"),
-                    lang.hitch(this, function(surveys) {
+            when(surveys.query({published:true}), lang.hitch(this, function(surveys) {
                 this.publishedTab.set('title','Published ('+surveys.length+')');
                 array.forEach(surveys,function(survey){
                     var w = new LineWithActionsWidget({
-                        title: Survey.DisplayTitle.get(survey),
+                        title: survey.title || "",
                         actions:[{
                             callback: lang.hitch(this,'_onPreviewSurvey',survey),
@@ -138,10 +136,9 @@
         refreshRuns: function() {
             this.runsContainer.set('content','');
-            when(store.query("_design/default/_view/by_type",{key:'SurveyRun'}),
-                    lang.hitch(this,function(surveyRuns){
+            when(surveyRuns.query(), lang.hitch(this,function(surveyRuns){
                 this.runsTab.set('title','Runs ('+surveyRuns.length+')');
                 array.forEach(surveyRuns,function(surveyRun){
                     var w = new LineWithActionsWidget({
-                        title: SurveyRun.DisplayTitle.get(surveyRun),
+                        title: surveyRun.title || "",
                         actions:[{
                             callback: lang.hitch(this,'_onRunDetails',surveyRun),
Index: Dev/trunk/src/client/qed-client/request.js
===================================================================
--- Dev/trunk/src/client/qed-client/request.js	(revision 486)
+++ 	(revision )
@@ -1,68 +1,0 @@
-define([
-    "./session",
-    "dojo/Deferred",
-    "dojo/on",
-    "dojo/request"
-], function(session, Deferred, on, request) {
-
-    var user = session.get();
-    var queue = [];
-    
-    on(session, 'change', function(newUser) {
-        user = newUser;
-        if ( user ) {
-            retry();
-        }
-    });
-    
-    function retry() {
-        if (queue.length > 0) {
-            var item = queue.shift();
-            console.log("Retry",item.url);
-            real_request(item);
-        }
-    }
-    
-    function real_request(item) {
-        var req = request(item.url,item.options);
-
-        // forward successfull response
-        req.then(function(body){
-            item.dfd.resolve(body);
-        });
-
-        // handle unauthenticated and queued requests
-        req.response.then(function(response){
-            retry();
-        }, function(error) {
-            if ( error.response.status === 401 ) {
-                queue.unshift(item);
-                session.restore();
-            } else {
-                item.dfd.reject(error); // this should be error body
-                                        // not, the request?
-                retry();
-            }
-        });
-    }
-    
-    var _request = function(url, options) {
-        var item = {
-            url: url,
-            options: options,
-            dfd: new Deferred()
-        };
-        // only do the request directly if we are authenticated and
-        // there are no earlier requests queued.
-        if ( user && queue.length === 0 ) {
-            console.log("Request",url);
-            real_request(item);
-        } else {
-            console.log("Push",url);
-            queue.push(item);
-        }
-        return item.dfd.promise;
-    };
-
-    return _request;
-});
Index: Dev/trunk/src/client/qed-client/response.js
===================================================================
--- Dev/trunk/src/client/qed-client/response.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/response.js	(revision 487)
@@ -4,8 +4,7 @@
     "./app/Path",
     "./lib/async",
-    "./model/classes/Response",
-    "./model/classes/SurveyRun",
+    "./model/classes/responses",
+    "./model/classes/surveyRuns",
     "./pages/response",
-    "./store",
     "dojo/_base/json",
     "dojo/date",
@@ -16,5 +15,5 @@
     "./stddeps",
     "dojo/domReady!"
-], function(Content, Page, Path, async, Response, SurveyRun, ResponsePage, store, json, date, locale, hash, parser, request) {
+], function(Content, Page, Path, async, responses, surveyRuns, ResponsePage, json, date, locale, hash, parser, request) {
     parser.parse();
     Content.startup();
@@ -26,63 +25,27 @@
     }
 
-    var path = new Path('/:surveyRunId');
+    var path = new Path('/:type/:id');
     var params = path.match(hash());
     params.options = params.options || {};
-
-    if ( !params || !params.surveyRunId ) {
+    
+    if ( params && params.type === 'surveyRuns' ) {
+        var response = responses.create();
+        response.surveyRunId = params.id;
+        responses.postWithSecret(response,params.options.secret)
+        .then(setContent,function(err){ error(err.error); });
+    } else if ( params && params.type === 'responses' ) {
+        responses.getWithSecret(params.id,params.options.secret)
+        .then(setContent,function(err){ error(err.error); });
+    } else {
         error("Something is wrong with the URL, don't know what survey to show you. Sorry.");
-        return;
     }
 
-    var surveyRunId = params.surveyRunId;
-
-    function checkDates(surveyRun) {
-        var now = new Date();
-        var startDate = SurveyRun.StartDate.get(surveyRun);
-        var endDate = SurveyRun.EndDate.get(surveyRun);
-        if ( startDate && date.compare(startDate,now) > 0 ) {
-            error("This survey will start on "+locale.format(startDate,'date'));
-            throw false;
-        }
-        if ( endDate && date.compare(now,endDate) > 0 ) {
-            error("This survey ended on "+locale.format(endDate,'date'));
-            throw false;
-        }
+    function setContent(response) {
+        hash(Path.format("/responses/"+responses.getId(response),
+                         {secret:response.secret}));
+        Content.set(new ResponsePage({
+            response: response
+        }));
     }
 
-    request.get('/api/surveyRuns/'+surveyRunId,{handleAs:'json'})
-    .then(function(surveyRun){
-        checkDates(surveyRun);
-        if ( params.options.id ) {
-            return params.options.id;
-        } else {
-            if ( surveyRun.mode === "open") {
-                var response = Response.create();
-                response.surveyRunId = surveyRunId;
-                return request.post('/api/responses',{
-                    handleAs:'json',
-                    data:json.toJson(response),
-                    headers:{"Content-Type": "application/json"}
-                }).then(function(res){
-                    return res.id;
-                });
-            } else {
-                error("Cannot respond to closed survey without response id. Sorry.");
-                throw false;
-            }
-        }
-        return surveyRun;
-    },function(){
-        error("No running survey found for the given id. Sorry.");
-        throw false;
-    })
-    .then(function(responseId){
-        hash(Path.format("/"+surveyRunId,{ id: responseId }));
-        Content.set(new ResponsePage({
-            surveyRunId: surveyRunId,
-            options: {
-                id: responseId
-            }
-        }));
-    });
 });
Index: Dev/trunk/src/client/qed-client/routes.js
===================================================================
--- Dev/trunk/src/client/qed-client/routes.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/routes.js	(revision 487)
@@ -1,13 +1,11 @@
 define([
-    './pages/index',
-    './pages/questions',
-    './pages/question',
-    './pages/surveys',
-    './pages/survey',
-    './pages/surveyRun',
-    './pages/sessions',
-    './pages/session',
-    './pages/previewSurvey'
-],function(index,questions,question,surveys,survey,surveyRun,sessions,session,previewSurvey){
+    "./pages/index",
+    "./pages/previewSurvey",
+    "./pages/question",
+    "./pages/questions",
+    "./pages/survey",
+    "./pages/surveyRun",
+    "./pages/surveys"
+], function(index, previewSurvey, question, questions, survey, surveyRun, surveys) {
 
     return [
Index: Dev/trunk/src/client/qed-client/session.coffee
===================================================================
--- Dev/trunk/src/client/qed-client/session.coffee	(revision 486)
+++ Dev/trunk/src/client/qed-client/session.coffee	(revision 487)
@@ -2,7 +2,8 @@
     "dojo/_base/declare",
     "dojo/_base/json",
+    "dojo/Deferred",
     "dojo/Evented",
     "dojo/request"
-], (declare, json, Evented, request) ->
+], (declare, json, Deferred, Evented, request) ->
     Session = declare [Evented],
         info: null
@@ -18,5 +19,5 @@
                 @_set res
             , () =>
-                throw (@_set null)
+                new Deferred().reject (@_set null)
 
         login: (username, password) ->
@@ -30,5 +31,5 @@
                 @_set res
             , () =>
-                throw (@_set null)
+                new Deferred().reject (@_set null)
 
         logout: () ->
@@ -45,5 +46,5 @@
                 @info = newInfo
                 @emit 'change', @info
-                @info
+            @info
 
     new Session()
Index: Dev/trunk/src/client/qed-client/stddeps.js
===================================================================
--- Dev/trunk/src/client/qed-client/stddeps.js	(revision 486)
+++ Dev/trunk/src/client/qed-client/stddeps.js	(revision 487)
@@ -1,3 +1,4 @@
 define([
+
     // dijit & rft widgets used declaratively in templates
     'dijit/Dialog',
@@ -43,3 +44,4 @@
     './widgets/Selector',
     './widgets/TitleGroup'
+
 ],function(){});
Index: Dev/trunk/src/client/qed-client/store.js
===================================================================
--- Dev/trunk/src/client/qed-client/store.js	(revision 486)
+++ 	(revision )
@@ -1,47 +1,0 @@
-define([
-    'dojo/date/stamp',
-    'dojo/store/Cache',
-    'dojo/store/Memory',
-    'dojox/json/schema',
-    './model/schema',
-    './request',
-    './store/CouchStore'
-],function(stamp,Cache,Memory,jsonSchema,schema,request,CouchStore){
-    
-    var couchStore = new CouchStore({
-        target: '/data/',
-        request: request /*,
-        validate: function(object) {
-            var result = jsonSchema.validate(object,schema);
-            if ( result.valid ) {
-                return true;
-            } else {
-                console.log("Found error ",result," for invalid object ",object);
-                return false;
-            }
-        }*/
-    });
-    var memoryStore = new Memory({
-        idProperty: couchStore.idProperty
-    });
-    var cacheStore = new Cache(couchStore,memoryStore,{
-        isLoaded: function(object) {
-            // Unfortunately we cannot determine of the full documents were
-            // loaded or not. Therefore never cache query results.
-            return false;
-        }
-    });
-
-    var store = cacheStore;
-    store.formatDate = function(date){
-        return stamp.toISOString(date,{zulu:true});
-    };
-    store.parseDate = function(dateString){
-        return stamp.fromISOString(dateString);
-    };
-    store.timestamp = function() {
-        return this.formatDate(new Date());
-    };
-    return store;
-
-});
Index: Dev/trunk/src/client/qed-client/store/JsonRest.js
===================================================================
--- Dev/trunk/src/client/qed-client/store/JsonRest.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/store/JsonRest.js	(revision 487)
@@ -0,0 +1,198 @@
+define(["../xhr", "dojo/_base/lang", "dojo/json", "dojo/io-query", "dojo/_base/declare", "dojo/store/util/QueryResults" /*=====, "./api/Store" =====*/
+], function(xhr, lang, JSON, ioQuery, declare, queryResults /*=====, Store =====*/){
+
+    // No base class, but for purposes of documentation, the base class is dojo/store/api/Store
+    var base = null;
+    /*===== base = Store; =====*/
+
+    /*=====
+    var __HeaderOptions = {
+            // headers: Object?
+            //        Additional headers to send along with the request.
+        },
+        __PutDirectives = declare(Store.PutDirectives, __HeaderOptions),
+        __QueryOptions = declare(Store.QueryOptions, __HeaderOptions);
+    =====*/
+
+    return declare("dojo.store.JsonRest", base, {
+        // summary:
+        //        This is a basic store for RESTful communicating with a server through JSON
+        //        formatted data. It implements dojo/store/api/Store.
+
+        constructor: function(options){
+            // summary:
+            //        This is a basic store for RESTful communicating with a server through JSON
+            //        formatted data.
+            // options: dojo/store/JsonRest
+            //        This provides any configuration information that will be mixed into the store
+            this.headers = {};
+            declare.safeMixin(this, options);
+        },
+
+        // headers: Object
+        //        Additional headers to pass in all requests to the server. These can be overridden
+        //        by passing additional headers to calls to the store.
+        headers: {},
+
+        // target: String
+        //        The target base URL to use for all requests to the server. This string will be
+        //        prepended to the id to generate the URL (relative or absolute) for requests
+        //        sent to the server
+        target: "",
+
+        // idProperty: String
+        //        Indicates the property to use as the identity property. The values of this
+        //        property should be unique.
+        idProperty: "id",
+
+        // sortParam: String
+        //        The query parameter to used for holding sort information. If this is omitted, than
+        //        the sort information is included in a functional query token to avoid colliding
+        //        with the set of name/value pairs.
+
+        // ascendingPrefix: String
+        //        The prefix to apply to sort attribute names that are ascending
+        ascendingPrefix: "+",
+
+        // descendingPrefix: String
+        //        The prefix to apply to sort attribute names that are ascending
+        descendingPrefix: "-",
+
+
+        get: function(id, options){
+            // summary:
+            //        Retrieves an object by its identity. This will trigger a GET request to the server using
+            //        the url `this.target + id`.
+            // id: Number
+            //        The identity to use to lookup the object
+            // options: Object?
+            //        HTTP headers. For consistency with other methods, if a `headers` key exists on this object, it will be
+            //        used to provide HTTP headers instead.
+            // returns: Object
+            //        The object in the store that matches the given id.
+            options = options || {};
+            var headers = lang.mixin({ Accept: this.accepts }, this.headers, options.headers || options);
+            return xhr("GET", {
+                url: this.target + id, 
+                handleAs: "json",
+                headers: headers
+            });
+        },
+
+        // accepts: String
+        //        Defines the Accept header to use on HTTP requests
+        accepts: "application/javascript, application/json",
+
+        getIdentity: function(object){
+            // summary:
+            //        Returns an object's identity
+            // object: Object
+            //        The object to get the identity from
+            // returns: Number
+            return object[this.idProperty];
+        },
+
+        put: function(object, options){
+            // summary:
+            //        Stores an object. This will trigger a PUT request to the server
+            //        if the object has an id, otherwise it will trigger a POST request.
+            // object: Object
+            //        The object to store.
+            // options: __PutDirectives?
+            //        Additional metadata for storing the data.  Includes an "id"
+            //        property if a specific id is to be used.
+            // returns: dojo/_base/Deferred
+            options = options || {};
+            var id = ("id" in options) ? options.id : this.getIdentity(object);
+            var hasId = typeof id !== "undefined";
+            return xhr(hasId && !options.incremental ? "PUT" : "POST", {
+                url: hasId ? this.target + id : this.target,
+                postData: JSON.stringify(object),
+                handleAs: "json",
+                headers: lang.mixin({
+                    "Content-Type": "application/json",
+                    Accept: this.accepts,
+                    "If-Match": options.overwrite === true ? "*" : null,
+                    "If-None-Match": options.overwrite === false ? "*" : null
+                }, this.headers, options.headers)
+            });
+        },
+
+        add: function(object, options){
+            // summary:
+            //        Adds an object. This will trigger a PUT request to the server
+            //        if the object has an id, otherwise it will trigger a POST request.
+            // object: Object
+            //        The object to store.
+            // options: __PutDirectives?
+            //        Additional metadata for storing the data.  Includes an "id"
+            //        property if a specific id is to be used.
+            options = options || {};
+            options.overwrite = false;
+            return this.put(object, options);
+        },
+
+        remove: function(id, options){
+            // summary:
+            //        Deletes an object by its identity. This will trigger a DELETE request to the server.
+            // id: Number
+            //        The identity to use to delete the object
+            // options: __HeaderOptions?
+            //        HTTP headers.
+            options = options || {};
+            return xhr("DELETE", {
+                url: this.target + id,
+                headers: lang.mixin({}, this.headers, options.headers)
+            });
+        },
+
+        query: function(query, options){
+            // summary:
+            //        Queries the store for objects. This will trigger a GET request to the server, with the
+            //        query added as a query string.
+            // query: Object
+            //        The query to use for retrieving objects from the store.
+            // options: __QueryOptions?
+            //        The optional arguments to apply to the resultset.
+            // returns: dojo/store/api/Store.QueryResults
+            //        The results of the query, extended with iterative methods.
+            options = options || {};
+
+            var headers = lang.mixin({ Accept: this.accepts }, this.headers, options.headers);
+
+            if(options.start >= 0 || options.count >= 0){
+                //set X-Range for Opera since it blocks "Range" header
+                headers.Range = headers["X-Range"] = "items=" + (options.start || '0') + '-' +
+                    (("count" in options && options.count !== Infinity) ?
+                        (options.count + (options.start || 0) - 1) : '');
+            }
+            var hasQuestionMark = this.target.indexOf("?") > -1;
+            if(query && typeof query === "object"){
+                query = ioQuery.objectToQuery(query);
+                query = query ? (hasQuestionMark ? "&" : "?") + query: "";
+            }
+            if(options && options.sort){
+                var sortParam = this.sortParam;
+                query += (query || hasQuestionMark ? "&" : "?") + (sortParam ? sortParam + '=' : "sort(");
+                for(var i = 0; i<options.sort.length; i++){
+                    var sort = options.sort[i];
+                    query += (i > 0 ? "," : "") + (sort.descending ? this.descendingPrefix : this.ascendingPrefix) + encodeURIComponent(sort.attribute);
+                }
+                if(!sortParam){
+                    query += ")";
+                }
+            }
+            var results = xhr("GET", {
+                url: this.target + (query || ""),
+                handleAs: "json",
+                headers: headers
+            });
+            results.total = results.then(function(){
+                var range = results.ioArgs.xhr.getResponseHeader("Content-Range");
+                return range && (range = range.match(/\/(.*)/)) && +range[1];
+            });
+            return queryResults(results);
+        }
+    });
+
+});
Index: Dev/trunk/src/client/qed-client/ui/LoginDialogWrapper.coffee
===================================================================
--- Dev/trunk/src/client/qed-client/ui/LoginDialogWrapper.coffee	(revision 486)
+++ Dev/trunk/src/client/qed-client/ui/LoginDialogWrapper.coffee	(revision 487)
@@ -17,5 +17,5 @@
             if @_started then return
             @inherited arguments
-            _on session, 'change', (lang.hitch @, @onUserChange)
+            _on session, 'change', (lang.hitch @, 'onUserChange')
             @onUserChange session.get()
         onLogin: (evt) ->
@@ -35,2 +35,3 @@
             else
                 @loginDialog.show()
+            null
Index: Dev/trunk/src/client/qed-client/xhr.js
===================================================================
--- Dev/trunk/src/client/qed-client/xhr.js	(revision 487)
+++ Dev/trunk/src/client/qed-client/xhr.js	(revision 487)
@@ -0,0 +1,65 @@
+define([
+    "./session",
+    "dojo/Deferred",
+    "dojo/_base/lang",
+    "dojo/on",
+    "dojo/_base/xhr"
+], function(session, Deferred, lang, on, xhr) {
+
+    var user = session.get();
+    var queue = [];
+    
+    on(session, 'change', function(newUser){
+        user = newUser;
+        retry();
+    });
+
+    function retry() {
+        if (user && queue.length > 0) {
+            var item = queue.shift();
+            console.log("Retry",item.options.url);
+            real_request(item);
+        }
+    }
+    
+    function real_request(item) {
+        var req = xhr(item.method,lang.mixin(item.options||{},{
+            failOk: true
+        }));
+        item.promise.ioArgs = req.ioArgs;
+
+        req.then(function(result){
+            item.dfd.resolve(result);
+            retry();
+        }, function(error){
+            if ( error.response.status === 401 ) {
+                queue.unshift(item);
+                session.restore();
+            } else {
+                item.dfd.reject(error);
+                retry();
+            }
+        });
+    }
+    
+    var _request = function(method, options) {
+        var item = {
+            method: method,
+            options: options,
+            dfd: new Deferred()
+        };
+        item.promise = lang.delegate(item.dfd.promise);
+        // only do the request directly if we are authenticated and
+        // there are no earlier requests queued.
+        if ( user && queue.length === 0 ) {
+            console.log("Request",options.url);
+            real_request(item);
+        } else {
+            console.log("Push",options.url);
+            queue.push(item);
+        }
+        return item.promise;
+    };
+
+    return _request;
+});
Index: Dev/trunk/src/node_modules/express/node_modules/buffer-crc32/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/buffer-crc32/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/buffer-crc32/package.json	(revision 487)
@@ -20,5 +20,5 @@
   "main": "index.js",
   "scripts": {
-    "test": "./node_modules/.bin/tap tests/*.test.js"
+    "test": "tap tests/*.test.js"
   },
   "dependencies": {},
@@ -36,4 +36,8 @@
   },
   "_id": "buffer-crc32@0.2.1",
-  "_from": "buffer-crc32@0.2.1"
+  "dist": {
+    "shasum": "d4831cc88b961550a88d829efbc0b139caf22d8c"
+  },
+  "_from": "buffer-crc32@0.2.1",
+  "_resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.1.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/commander/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/commander/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/commander/package.json	(revision 487)
@@ -34,5 +34,10 @@
     "url": "https://github.com/visionmedia/commander.js/issues"
   },
+  "homepage": "https://github.com/visionmedia/commander.js",
   "_id": "commander@0.6.1",
-  "_from": "commander@0.6.1"
+  "dist": {
+    "shasum": "c725ed5e9b2bf532b3fe3cba4f81b552cecf0550"
+  },
+  "_from": "commander@0.6.1",
+  "_resolved": "https://registry.npmjs.org/commander/-/commander-0.6.1.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/bytes/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/bytes/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/bytes/package.json	(revision 487)
@@ -17,4 +17,8 @@
   "readmeFilename": "Readme.md",
   "_id": "bytes@0.2.0",
-  "_from": "bytes@0.2.0"
+  "dist": {
+    "shasum": "b4c569295d86a498a119945f1d8a26f76e4b5462"
+  },
+  "_from": "bytes@0.2.0",
+  "_resolved": "https://registry.npmjs.org/bytes/-/bytes-0.2.0.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/cookie/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/cookie/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/cookie/package.json	(revision 487)
@@ -32,5 +32,10 @@
     "url": "https://github.com/shtylman/node-cookie/issues"
   },
+  "homepage": "https://github.com/shtylman/node-cookie",
   "_id": "cookie@0.0.5",
-  "_from": "cookie@0.0.5"
+  "dist": {
+    "shasum": "2597397e06ec3eaf53c88851570e97949c1e4dcd"
+  },
+  "_from": "cookie@0.0.5",
+  "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.0.5.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/formidable/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/formidable/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/formidable/package.json	(revision 487)
@@ -35,4 +35,8 @@
   "dependencies": {},
   "_id": "formidable@1.0.14",
-  "_from": "formidable@1.0.14"
+  "dist": {
+    "shasum": "08be7c89a9ebffbe5b2fbd4df0ad3f5cd19c5147"
+  },
+  "_from": "formidable@1.0.14",
+  "_resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/pause/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/pause/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/pause/package.json	(revision 487)
@@ -17,4 +17,8 @@
   "readmeFilename": "Readme.md",
   "_id": "pause@0.0.1",
-  "_from": "pause@0.0.1"
+  "dist": {
+    "shasum": "dc3b2287742f3f6249f2d228e74cff5a3f9fe8da"
+  },
+  "_from": "pause@0.0.1",
+  "_resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/qs/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/qs/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/qs/package.json	(revision 487)
@@ -33,5 +33,10 @@
     "url": "https://github.com/visionmedia/node-querystring/issues"
   },
+  "homepage": "https://github.com/visionmedia/node-querystring",
   "_id": "qs@0.6.5",
-  "_from": "qs@0.6.5"
+  "dist": {
+    "shasum": "cdaafb6ed1dbcf48405f41ca92bf95361ad923dc"
+  },
+  "_from": "qs@0.6.5",
+  "_resolved": "https://registry.npmjs.org/qs/-/qs-0.6.5.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/README.md
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/README.md	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/README.md	(revision 487)
@@ -12,5 +12,5 @@
 
 ### mime.lookup(path)
-Get the mime type associated with a file. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.
+Get the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.
 
     var mime = require('mime');
@@ -20,4 +20,7 @@
     mime.lookup('.TXT');                      // => 'text/plain'
     mime.lookup('htm');                       // => 'text/html'
+
+### mime.default_type
+Sets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)
 
 ### mime.extension(type)
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/mime.js
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/mime.js	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/mime.js	(revision 487)
@@ -70,5 +70,5 @@
  */
 Mime.prototype.lookup = function(path, fallback) {
-  var ext = path.replace(/.*[\.\/]/, '').toLowerCase();
+  var ext = path.replace(/.*[\.\/\\]/, '').toLowerCase();
 
   return this.types[ext] || fallback || this.default_type;
@@ -79,5 +79,6 @@
  */
 Mime.prototype.extension = function(mimeType) {
-  return this.extensions[mimeType];
+  var type = mimeType.match(/^\s*([^;\s]*)(?:;|\s|$)/)[1].toLowerCase();
+  return this.extensions[type];
 };
 
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/package.json	(revision 487)
@@ -25,11 +25,12 @@
     "type": "git"
   },
-  "version": "1.2.9",
-  "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n    npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.\n\n    var mime = require('mime');\n\n    mime.lookup('/path/to/file.txt');         // => 'text/plain'\n    mime.lookup('file.txt');                  // => 'text/plain'\n    mime.lookup('.TXT');                      // => 'text/plain'\n    mime.lookup('htm');                       // => 'text/html'\n\n### mime.extension(type)\nGet the default extension for `type`\n\n    mime.extension('text/html');                 // => 'html'\n    mime.extension('application/octet-stream');  // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n    mime.charsets.lookup('text/plain');        // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary.  Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project.  If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n    mime.define({\n        'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n        'application/x-my-type': ['x-mt', 'x-mtt'],\n        // etc ...\n    });\n\n    mime.lookup('x-sft');                 // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n    mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n    mime.load('./my_project.types');\n\nThe .types file format is simple -  See the `types` dir for examples.\n",
+  "version": "1.2.11",
+  "readme": "# mime\n\nComprehensive MIME type mapping API. Includes all 600+ types and 800+ extensions defined by the Apache project, plus additional types submitted by the node.js community.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n    npm install mime\n\n## API - Queries\n\n### mime.lookup(path)\nGet the mime type associated with a file, if no mime type is found `application/octet-stream` is returned. Performs a case-insensitive lookup using the extension in `path` (the substring after the last '/' or '.').  E.g.\n\n    var mime = require('mime');\n\n    mime.lookup('/path/to/file.txt');         // => 'text/plain'\n    mime.lookup('file.txt');                  // => 'text/plain'\n    mime.lookup('.TXT');                      // => 'text/plain'\n    mime.lookup('htm');                       // => 'text/html'\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\n\n### mime.extension(type)\nGet the default extension for `type`\n\n    mime.extension('text/html');                 // => 'html'\n    mime.extension('application/octet-stream');  // => 'bin'\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n    mime.charsets.lookup('text/plain');        // => 'UTF-8'\n\n(The logic for charset lookups is pretty rudimentary.  Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nThe following APIs allow you to add your own type mappings within your project.  If you feel a type should be included as part of node-mime, see [requesting new types](https://github.com/broofa/node-mime/wiki/Requesting-New-Types).\n\n### mime.define()\n\nAdd custom mime/extension mappings\n\n    mime.define({\n        'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n        'application/x-my-type': ['x-mt', 'x-mtt'],\n        // etc ...\n    });\n\n    mime.lookup('x-sft');                 // => 'text/x-some-format'\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n    mime.extension('text/x-some-format'); // => 'x-sf'\n\n### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n    mime.load('./my_project.types');\n\nThe .types file format is simple -  See the `types` dir for examples.\n",
   "readmeFilename": "README.md",
   "bugs": {
     "url": "https://github.com/broofa/node-mime/issues"
   },
-  "_id": "mime@1.2.9",
+  "homepage": "https://github.com/broofa/node-mime",
+  "_id": "mime@1.2.11",
   "_from": "mime@~1.2.9"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/test.js
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/test.js	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/test.js	(revision 487)
@@ -5,4 +5,5 @@
 var mime = require('./mime');
 var assert = require('assert');
+var path = require('path');
 
 function eq(a, b) {
@@ -18,14 +19,14 @@
 //
 
-eq('text/plain', mime.lookup('text.txt'));
-eq('text/plain', mime.lookup('.text.txt'));
-eq('text/plain', mime.lookup('.txt'));
-eq('text/plain', mime.lookup('txt'));
-eq('application/octet-stream', mime.lookup('text.nope'));
-eq('fallback', mime.lookup('text.fallback', 'fallback'));
-eq('application/octet-stream', mime.lookup('constructor'));
-eq('text/plain', mime.lookup('TEXT.TXT'));
-eq('text/event-stream', mime.lookup('text/event-stream'));
-eq('application/x-web-app-manifest+json', mime.lookup('text.webapp'));
+eq('text/plain', mime.lookup('text.txt'));     // normal file
+eq('text/plain', mime.lookup('TEXT.TXT'));     // uppercase
+eq('text/plain', mime.lookup('dir/text.txt')); // dir + file
+eq('text/plain', mime.lookup('.text.txt'));    // hidden file
+eq('text/plain', mime.lookup('.txt'));         // nameless
+eq('text/plain', mime.lookup('txt'));          // extension-only
+eq('text/plain', mime.lookup('/txt'));         // extension-less ()
+eq('text/plain', mime.lookup('\\txt'));        // Windows, extension-less
+eq('application/octet-stream', mime.lookup('text.nope')); // unrecognized
+eq('fallback', mime.lookup('text.fallback', 'fallback')); // alternate default
 
 //
@@ -36,12 +37,21 @@
 eq('html', mime.extension(mime.types.htm));
 eq('bin', mime.extension('application/octet-stream'));
-eq(undefined, mime.extension('constructor'));
+eq('bin', mime.extension('application/octet-stream '));
+eq('html', mime.extension(' text/html; charset=UTF-8'));
+eq('html', mime.extension('text/html; charset=UTF-8 '));
+eq('html', mime.extension('text/html; charset=UTF-8'));
+eq('html', mime.extension('text/html ; charset=UTF-8'));
+eq('html', mime.extension('text/html;charset=UTF-8'));
+eq('html', mime.extension('text/Html;charset=UTF-8'));
+eq(undefined, mime.extension('unrecognized'));
 
 //
-// Test node types
+// Test node.types lookups
 //
 
+eq('application/font-woff', mime.lookup('file.woff'));
 eq('application/octet-stream', mime.lookup('file.buffer'));
 eq('audio/mp4', mime.lookup('file.m4a'));
+eq('font/opentype', mime.lookup('file.otf'));
 
 //
@@ -53,3 +63,22 @@
 eq('fallback', mime.charsets.lookup('application/octet-stream', 'fallback'));
 
+//
+// Test for overlaps between mime.types and node.types
+//
+
+var apacheTypes = new mime.Mime(), nodeTypes = new mime.Mime();
+apacheTypes.load(path.join(__dirname, 'types/mime.types'));
+nodeTypes.load(path.join(__dirname, 'types/node.types'));
+
+var keys = [].concat(Object.keys(apacheTypes.types))
+             .concat(Object.keys(nodeTypes.types));
+keys.sort();
+for (var i = 1; i < keys.length; i++) {
+  if (keys[i] == keys[i-1]) {
+    console.warn('Warning: ' +
+      'node.types defines ' + keys[i] + '->' + nodeTypes.types[keys[i]] +
+      ', mime.types defines ' + keys[i] + '->' + apacheTypes.types[keys[i]]);
+  }
+}
+
 console.log('\nOK');
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/types/mime.types
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/types/mime.types	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/types/mime.types	(revision 487)
@@ -1055,5 +1055,5 @@
 application/x-font-ttf				ttf ttc
 application/x-font-type1			pfa pfb pfm afm
-application/x-font-woff				woff
+application/font-woff				woff
 # application/x-font-vfont
 application/x-freearc				arc
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/types/node.types
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/types/node.types	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/node_modules/mime/types/node.types	(revision 487)
@@ -16,9 +16,9 @@
 text/x-component  htc
 
-# What: HTML5 application cache manifest
+# What: HTML5 application cache manifes ('.manifest' extension)
 # Why: De-facto standard. Required by Mozilla browser when serving HTML5 apps
 # per https://developer.mozilla.org/en/offline_resources_in_firefox
 # Added by: louisremi
-text/cache-manifest  appcache manifest
+text/cache-manifest  manifest
 
 # What: node binary buffer format
@@ -59,2 +59,19 @@
 # Added by: avoidwork
 text/x-markdown  markdown md mkd
+
+# What: ini files
+# Why: because they're just text files
+# Added by: Matthew Kastor
+text/plain  ini
+
+# What: DASH Adaptive Streaming manifest
+# Why: https://developer.mozilla.org/en-US/docs/DASH_Adaptive_Streaming_for_HTML_5_Video
+# Added by: eelcocramer
+application/dash+xml mdp
+
+# What: OpenType font files - http://www.microsoft.com/typography/otspec/
+# Why:  Browsers usually ignore the font MIME types and sniff the content,
+#       but Chrome, shows a warning if OpenType fonts aren't served with
+#       the `font/opentype` MIME type: http://i.imgur.com/8c5RN8M.png.
+# Added by: alrra
+font/opentype  otf
Index: Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/node_modules/send/package.json	(revision 487)
@@ -37,5 +37,10 @@
     "url": "https://github.com/visionmedia/send/issues"
   },
+  "homepage": "https://github.com/visionmedia/send",
   "_id": "send@0.1.1",
-  "_from": "send@0.1.1"
+  "dist": {
+    "shasum": "40ded726322604c29d7229683f9207bd6d76e217"
+  },
+  "_from": "send@0.1.1",
+  "_resolved": "https://registry.npmjs.org/send/-/send-0.1.1.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/connect/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/connect/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/connect/package.json	(revision 487)
@@ -49,5 +49,10 @@
     "url": "https://github.com/senchalabs/connect/issues"
   },
+  "homepage": "https://github.com/senchalabs/connect",
   "_id": "connect@2.7.11",
-  "_from": "connect@2.7.11"
+  "dist": {
+    "shasum": "839e3928b727827db859a4b3a1d04ea9a06b6ab1"
+  },
+  "_from": "connect@2.7.11",
+  "_resolved": "https://registry.npmjs.org/connect/-/connect-2.7.11.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/cookie-signature/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/cookie-signature/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/cookie-signature/package.json	(revision 487)
@@ -21,4 +21,8 @@
   "readmeFilename": "Readme.md",
   "_id": "cookie-signature@1.0.1",
-  "_from": "cookie-signature@1.0.1"
+  "dist": {
+    "shasum": "404efcace10fb30f3451483045d743463ae8602c"
+  },
+  "_from": "cookie-signature@1.0.1",
+  "_resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.1.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/cookie/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/cookie/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/cookie/package.json	(revision 487)
@@ -32,5 +32,10 @@
     "url": "https://github.com/shtylman/node-cookie/issues"
   },
+  "homepage": "https://github.com/shtylman/node-cookie",
   "_id": "cookie@0.1.0",
-  "_from": "cookie@0.1.0"
+  "dist": {
+    "shasum": "b56ac6108fcab9073208d405c4fa8aaa35f00810"
+  },
+  "_from": "cookie@0.1.0",
+  "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.1.0.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/debug/Readme.md
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/debug/Readme.md	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/debug/Readme.md	(revision 487)
@@ -1,3 +1,2 @@
-
 # debug
 
@@ -59,8 +58,9 @@
   ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)
 
-  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+  When stderr is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:
+  _(NOTE: Debug now uses stderr instead of stdout, so the correct shell command for this example is actually `DEBUG=* node example/worker 2> out &`)_
   
   ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)
-
+  
 ## Conventions
 
Index: Dev/trunk/src/node_modules/express/node_modules/debug/debug.js
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/debug/debug.js	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/debug/debug.js	(revision 487)
@@ -18,4 +18,6 @@
 
   return function(fmt){
+    fmt = coerce(fmt);
+
     var curr = new Date;
     var ms = curr - (debug[name] || curr);
@@ -120,5 +122,16 @@
 };
 
+/**
+ * Coerce `val`.
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
+
 // persist
 
-if (window.localStorage) debug.enable(localStorage.debug);
+try {
+  if (window.localStorage) debug.enable(localStorage.debug);
+} catch(e){}
Index: Dev/trunk/src/node_modules/express/node_modules/debug/lib/debug.js
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/debug/lib/debug.js	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/debug/lib/debug.js	(revision 487)
@@ -109,4 +109,6 @@
 
   function colored(fmt) {
+    fmt = coerce(fmt);
+
     var curr = new Date;
     var ms = curr - (prev[name] || curr);
@@ -122,4 +124,6 @@
 
   function plain(fmt) {
+    fmt = coerce(fmt);
+
     fmt = new Date().toUTCString()
       + ' ' + name + ' ' + fmt;
@@ -133,2 +137,11 @@
     : plain;
 }
+
+/**
+ * Coerce `val`.
+ */
+
+function coerce(val) {
+  if (val instanceof Error) return val.stack || val.message;
+  return val;
+}
Index: Dev/trunk/src/node_modules/express/node_modules/debug/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/debug/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/debug/package.json	(revision 487)
@@ -1,5 +1,5 @@
 {
   "name": "debug",
-  "version": "0.7.2",
+  "version": "0.7.4",
   "repository": {
     "type": "git",
@@ -21,8 +21,13 @@
   },
   "main": "lib/debug.js",
-  "browserify": "debug.js",
+  "browser": "./debug.js",
   "engines": {
     "node": "*"
   },
+  "files": [
+    "lib/debug.js",
+    "debug.js",
+    "index.js"
+  ],
   "component": {
     "scripts": {
@@ -31,11 +36,11 @@
     }
   },
-  "readme": "\n# debug\n\n  tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n  , http = require('http')\n  , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n  debug(req.method + ' ' + req.url);\n  res.end('hello\\n');\n}).listen(3000, function(){\n  debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n  debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n  When stdout is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n  \n  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n\n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n  The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n  You can also exclude specific debuggers by prefixing them with a \"-\" character.  For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n  a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n  a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
+  "readme": "# debug\n\n  tiny node.js debugging utility modelled after node core's debugging technique.\n\n## Installation\n\n```\n$ npm install debug\n```\n\n## Usage\n\n With `debug` you simply invoke the exported function to generate your debug function, passing it a name which will determine if a noop function is returned, or a decorated `console.error`, so all of the `console` format string goodies you're used to work fine. A unique color is selected per-function for visibility.\n \nExample _app.js_:\n\n```js\nvar debug = require('debug')('http')\n  , http = require('http')\n  , name = 'My App';\n\n// fake app\n\ndebug('booting %s', name);\n\nhttp.createServer(function(req, res){\n  debug(req.method + ' ' + req.url);\n  res.end('hello\\n');\n}).listen(3000, function(){\n  debug('listening');\n});\n\n// fake worker of some kind\n\nrequire('./worker');\n```\n\nExample _worker.js_:\n\n```js\nvar debug = require('debug')('worker');\n\nsetInterval(function(){\n  debug('doing some work');\n}, 1000);\n```\n\n The __DEBUG__ environment variable is then used to enable these based on space or comma-delimited names. Here are some examples:\n\n  ![debug http and worker](http://f.cl.ly/items/18471z1H402O24072r1J/Screenshot.png)\n\n  ![debug worker](http://f.cl.ly/items/1X413v1a3M0d3C2c1E0i/Screenshot.png)\n\n## Millisecond diff\n\n  When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the \"+NNNms\" will show you how much time was spent between calls.\n\n  ![](http://f.cl.ly/items/2i3h1d3t121M2Z1A3Q0N/Screenshot.png)\n\n  When stderr is not a TTY, `Date#toUTCString()` is used, making it more useful for logging the debug information as shown below:\n  _(NOTE: Debug now uses stderr instead of stdout, so the correct shell command for this example is actually `DEBUG=* node example/worker 2> out &`)_\n  \n  ![](http://f.cl.ly/items/112H3i0e0o0P0a2Q2r11/Screenshot.png)\n  \n## Conventions\n\n If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use \":\" to separate features. For example \"bodyParser\" from Connect would then be \"connect:bodyParser\". \n\n## Wildcards\n\n  The \"*\" character may be used as a wildcard. Suppose for example your library has debuggers named \"connect:bodyParser\", \"connect:compress\", \"connect:session\", instead of listing all three with `DEBUG=connect:bodyParser,connect.compress,connect:session`, you may simply do `DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.\n\n  You can also exclude specific debuggers by prefixing them with a \"-\" character.  For example, `DEBUG=* -connect:*` would include all debuggers except those starting with \"connect:\".\n\n## Browser support\n\n Debug works in the browser as well, currently persisted by `localStorage`. For example if you have `worker:a` and `worker:b` as shown below, and wish to debug both type `debug.enable('worker:*')` in the console and refresh the page, this will remain until you disable with `debug.disable()`. \n\n```js\na = debug('worker:a');\nb = debug('worker:b');\n\nsetInterval(function(){\n  a('doing some work');\n}, 1000);\n\nsetInterval(function(){\n  a('doing some work');\n}, 1200);\n```\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n",
   "readmeFilename": "Readme.md",
   "bugs": {
     "url": "https://github.com/visionmedia/debug/issues"
   },
-  "_id": "debug@0.7.2",
-  "_from": "debug@*",
-  "scripts": {}
+  "homepage": "https://github.com/visionmedia/debug",
+  "_id": "debug@0.7.4",
+  "_from": "debug@*"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/fresh/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/fresh/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/fresh/package.json	(revision 487)
@@ -17,4 +17,8 @@
   "readmeFilename": "Readme.md",
   "_id": "fresh@0.1.0",
-  "_from": "fresh@0.1.0"
+  "dist": {
+    "shasum": "97ce63fda273b033f866d3a29b9920d034aa2074"
+  },
+  "_from": "fresh@0.1.0",
+  "_resolved": "https://registry.npmjs.org/fresh/-/fresh-0.1.0.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/methods/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/methods/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/methods/package.json	(revision 487)
@@ -17,4 +17,8 @@
   "readme": "ERROR: No README data found!",
   "_id": "methods@0.0.1",
-  "_from": "methods@0.0.1"
+  "dist": {
+    "shasum": "c0a484b3e1f28764c5cfd234e1a156d47092ecca"
+  },
+  "_from": "methods@0.0.1",
+  "_resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/mkdirp/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/mkdirp/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/mkdirp/package.json	(revision 487)
@@ -32,5 +32,10 @@
     "url": "https://github.com/substack/node-mkdirp/issues"
   },
+  "homepage": "https://github.com/substack/node-mkdirp",
   "_id": "mkdirp@0.3.4",
-  "_from": "mkdirp@0.3.4"
+  "dist": {
+    "shasum": "8642eb45b73f5cd19824e94b572871013af8a305"
+  },
+  "_from": "mkdirp@0.3.4",
+  "_resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.3.4.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/range-parser/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/range-parser/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/range-parser/package.json	(revision 487)
@@ -17,4 +17,8 @@
   "readmeFilename": "Readme.md",
   "_id": "range-parser@0.0.4",
-  "_from": "range-parser@0.0.4"
+  "dist": {
+    "shasum": "a91c03c737187765f0dcdbe32fa824e52b47a9a6"
+  },
+  "_from": "range-parser@0.0.4",
+  "_resolved": "https://registry.npmjs.org/range-parser/-/range-parser-0.0.4.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/send/node_modules/mime/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/send/node_modules/mime/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/send/node_modules/mime/package.json	(revision 487)
@@ -31,5 +31,10 @@
     "url": "https://github.com/broofa/node-mime/issues"
   },
+  "homepage": "https://github.com/broofa/node-mime",
   "_id": "mime@1.2.6",
-  "_from": "mime@1.2.6"
+  "dist": {
+    "shasum": "193c6817fabeefd6a5f29acabd0b6cebc2c0910f"
+  },
+  "_from": "mime@1.2.6",
+  "_resolved": "https://registry.npmjs.org/mime/-/mime-1.2.6.tgz"
 }
Index: Dev/trunk/src/node_modules/express/node_modules/send/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/node_modules/send/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/node_modules/send/package.json	(revision 487)
@@ -31,4 +31,8 @@
   "readmeFilename": "Readme.md",
   "_id": "send@0.1.0",
-  "_from": "send@0.1.0"
+  "dist": {
+    "shasum": "4ea2b3aca167b22699fdbe4eb5bce35fc57ca7d5"
+  },
+  "_from": "send@0.1.0",
+  "_resolved": "https://registry.npmjs.org/send/-/send-0.1.0.tgz"
 }
Index: Dev/trunk/src/node_modules/express/package.json
===================================================================
--- Dev/trunk/src/node_modules/express/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/express/package.json	(revision 487)
@@ -80,5 +80,10 @@
     "url": "https://github.com/visionmedia/express/issues"
   },
+  "homepage": "https://github.com/visionmedia/express",
   "_id": "express@3.2.6",
-  "_from": "express@~3.2.3"
+  "dist": {
+    "shasum": "4e16430ceaf29ac1f185c6996d50ca6394ec6357"
+  },
+  "_from": "express@3.2.6",
+  "_resolved": "https://registry.npmjs.org/express/-/express-3.2.6.tgz"
 }
Index: Dev/trunk/src/node_modules/tv4/README.md
===================================================================
--- Dev/trunk/src/node_modules/tv4/README.md	(revision 486)
+++ Dev/trunk/src/node_modules/tv4/README.md	(revision 487)
@@ -85,5 +85,5 @@
 ## Cyclical JavaScript objects
 
-While they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional final argument, checkRecursive. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script.
+While they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional third argument: `checkRecursive`. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script.
 
 Consider this data, notice how both `a` and `b` refer to each other:
@@ -99,16 +99,26 @@
 ```
 
-If the final checkRecursive argument were missing, this would throw a "too much recursion" error. 
-
-To enable supprot for this pass `true` as additional argument to any of the regular validation methods: 
+If the `checkRecursive` argument were missing, this would throw a "too much recursion" error. 
+
+To enable support for this, pass `true` as additional argument to any of the regular validation methods: 
 
 ```javascript
 tv4.validate(a, aSchema, true);
-tv4.validate(a, schema, asynchronousFunction, true);
-
 tv4.validateResult(data, aSchema, true); 
 tv4.validateMultiple(data, aSchema, true);
 ```
 
+## The `banUnknownProperties` flag
+
+Sometimes, it is desirable to flag all unknown properties as an error.  This is especially useful during development, to catch typos and the like, even when extra custom-defined properties are allowed.
+
+As such, tv4 implements ["ban unknown properties" mode](https://github.com/json-schema/json-schema/wiki/ban-unknown-properties-mode-\(v5-proposal\)), enabled by a fourth-argument flag:
+
+```javascript
+tv4.validate(data, schema, checkRecursive, true);
+tv4.validateResult(data, schema, checkRecursive, true);
+tv4.validateMultiple(data, schema, checkRecursive, true);
+```
+
 ## API
 
@@ -229,5 +239,5 @@
 ##### addFormat(format, validationFunction)
 
-Add a custom format validator.
+Add a custom format validator. (There are no built-in format validators.)
 
 * `format` is a string, corresponding to the `"format"` value in schemas.
Index: Dev/trunk/src/node_modules/tv4/package.json
===================================================================
--- Dev/trunk/src/node_modules/tv4/package.json	(revision 486)
+++ Dev/trunk/src/node_modules/tv4/package.json	(revision 487)
@@ -1,5 +1,5 @@
 {
   "name": "tv4",
-  "version": "1.0.11",
+  "version": "1.0.16",
   "author": {
     "name": "Geraint Luff"
@@ -51,5 +51,6 @@
     "grunt-markdown": "~0.3.0",
     "grunt-component": "~0.1.4",
-    "grunt-push-release": "~0.1.1"
+    "grunt-push-release": "~0.1.1",
+    "grunt-regex-replace": "~0.2.5"
   },
   "engines": {
@@ -57,7 +58,8 @@
   },
   "scripts": {
-    "test": "grunt test"
+    "test": "grunt test",
+    "prepublish": "grunt prepublish"
   },
-  "readme": "# Tiny Validator (for v4 JSON Schema)\n\n[![Build Status](https://secure.travis-ci.org/geraintluff/tv4.png?branch=master)](http://travis-ci.org/geraintluff/tv4) [![Dependency Status](https://gemnasium.com/geraintluff/tv4.png)](https://gemnasium.com/geraintluff/tv4) [![NPM version](https://badge.fury.io/js/tv4.png)](http://badge.fury.io/js/tv4)\n\nUse [json-schema](http://json-schema.org/) [draft v4](http://json-schema.org/latest/json-schema-core.html) to validate simple values and complex objects using a rich [validation vocabulary](http://json-schema.org/latest/json-schema-validation.html) ([examples](http://json-schema.org/examples.html)).\n\nThere is support for `$ref` with JSON Pointer fragment paths (```other-schema.json#/properties/myKey```).\n\n## Usage 1: Simple validation\n\n```javascript\nvar valid = tv4.validate(data, schema);\n```\n\nIf validation returns ```false```, then an explanation of why validation failed can be found in ```tv4.error```.\n\nThe error object will look something like:\n```json\n{\n    \"code\": 0,\n    \"message\": \"Invalid type: string\",\n    \"dataPath\": \"/intKey\",\n    \"schemaKey\": \"/properties/intKey/type\"\n}\n```\n\nThe `\"code\"` property will refer to one of the values in `tv4.errorCodes` - in this case, `tv4.errorCodes.INVALID_TYPE`.\n\nTo enable external schema to be referenced, you use:\n```javascript\ntv4.addSchema(url, schema);\n```\n\nIf schemas are referenced (```$ref```) but not known, then validation will return ```true``` and the missing schema(s) will be listed in ```tv4.missing```. For more info see the API documentation below.\n\n## Usage 2: Multi-threaded validation\n\nStoring the error and missing schemas does not work well in multi-threaded environments, so there is an alternative syntax:\n\n```javascript\nvar result = tv4.validateResult(data, schema);\n```\n\nThe result will look something like:\n```json\n{\n    \"valid\": false,\n    \"error\": {...},\n    \"missing\": [...]\n}\n```\n\n## Usage 3: Multiple errors\n\nNormally, `tv4` stops when it encounters the first validation error.  However, you can collect an array of validation errors using:\n\n```javascript\nvar result = tv4.validateMultiple(data, schema);\n```\n\nThe result will look something like:\n```json\n{\n    \"valid\": false,\n    \"errors\": [\n        {...},\n        ...\n    ],\n    \"missing\": [...]\n}\n```\n\n## Asynchronous validation\n\nSupport for asynchronous validation (where missing schemas are fetched) can be added by including an extra JavaScript file.  Currently, the only version requires jQuery (`tv4.async-jquery.js`), but the code is very short and should be fairly easy to modify for other libraries (such as MooTools).\n\nUsage:\n\n```javascript\ntv4.validate(data, schema, function (isValid, validationError) { ... });\n```\n\n`validationFailure` is simply taken from `tv4.error`.\n\n## Cyclical JavaScript objects\n\nWhile they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional final argument, checkRecursive. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script.\n\nConsider this data, notice how both `a` and `b` refer to each other:\n\n```javascript\nvar a = {};\nvar b = { a: a };\na.b = b;\nvar aSchema = { properties: { b: { $ref: 'bSchema' }}};\nvar bSchema = { properties: { a: { $ref: 'aSchema' }}};\ntv4.addSchema('aSchema', aSchema);\ntv4.addSchema('bSchema', bSchema);\n```\n\nIf the final checkRecursive argument were missing, this would throw a \"too much recursion\" error. \n\nTo enable supprot for this pass `true` as additional argument to any of the regular validation methods: \n\n```javascript\ntv4.validate(a, aSchema, true);\ntv4.validate(a, schema, asynchronousFunction, true);\n\ntv4.validateResult(data, aSchema, true); \ntv4.validateMultiple(data, aSchema, true);\n```\n\n## API\n\nThere are additional api commands available for more complex use-cases:\n\n##### addSchema(uri, schema)\nPre-register a schema for reference by other schema and synchronous validation.\n\n````js\ntv4.addSchema('http://example.com/schema', { ... });\n````\n\n* `uri` the uri to identify this schema.\n* `schema` the schema object.\n\nSchemas that have their `id` property set can be added directly.\n\n````js\ntv4.addSchema({ ... });\n````\n\n##### getSchema(uri)\n\nReturn a schema from the cache.\n\n* `uri` the uri of the schema (may contain a `#` fragment)\n\n````js\nvar schema = tv4.getSchema('http://example.com/schema');\n````\n\n##### getSchemaMap()\n\nReturn a shallow copy of the schema cache, mapping schema document URIs to schema objects.\n\n````\nvar map = tv4.getSchemaMap();\n\nvar schema = map[uri];\n````\n\n##### getSchemaUris(filter)\n\nReturn an Array with known schema document URIs.\n\n* `filter` optional RegExp to filter URIs\n\n````\nvar arr = tv4.getSchemaUris();\n\n// optional filter using a RegExp\nvar arr = tv4.getSchemaUris(/^https?://example.com/);\n````\n\n##### getMissingUris(filter)\n\nReturn an Array with schema document URIs that are used as `$ref` in known schemas but which currently have no associated schema data.\n\nUse this in combination with `tv4.addSchema(uri, schema)` to preload the cache for complete synchronous validation with.\n\n* `filter` optional RegExp to filter URIs\n\n````\nvar arr = tv4.getMissingUris();\n\n// optional filter using a RegExp\nvar arr = tv4.getMissingUris(/^https?://example.com/);\n````\n\n##### dropSchemas()\n\nDrop all known schema document URIs from the cache.\n\n````\ntv4.dropSchemas();\n````\n\n##### freshApi()\n\nReturn a new tv4 instance with no shared state.\n\n````\nvar otherTV4 = tv4.freshApi();\n````\n\n##### reset()\n\nManually reset validation status from the simple `tv4.validate(data, schema)`. Although tv4 will self reset on each validation there are some implementation scenarios where this is useful.\n\n````\ntv4.reset();\n````\n\n##### language(code)\n\nSelect the language map used for reporting.\n\n* `code` is a language code, like `'en'` or `'en-gb'`\n\n````\ntv4.language('en-gb');\n````\n\n##### addLanguage(code, map)\n\nAdd a new language map for selection by `tv4.language(code)`\n\n* `code` is new language code\n* `map` is an object mapping error IDs or constant names (e.g. `103` or `\"NUMBER_MAXIMUM\"`) to language strings.\n\n````\ntv4.addLanguage('fr', { ... });\n\n// select for use\ntv4.language('fr')\n````\n\n##### addFormat(format, validationFunction)\n\nAdd a custom format validator.\n\n* `format` is a string, corresponding to the `\"format\"` value in schemas.\n* `validationFunction` is a function that either returns:\n  * `null` (meaning no error)\n  * an error string (explaining the reason for failure)\n\n````\ntv4.addFormat('decimal-digits', function (data, schema) {\n\tif (typeof data === 'string' && !/^[0-9]+$/.test(data)) {\n\t\treturn null;\n\t}\n\treturn \"must be string of decimal digits\";\n});\n````\n\nAlternatively, multiple formats can be added at the same time using an object:\n````\ntv4.addFormat({\n\t'my-format': function () {...},\n\t'other-format': function () {...}\n});\n````\n\n## Demos\n\n### Basic usage\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo1\">\n<pre class=\"code\" id=\"demo1\">\nvar schema = {\n\t\"items\": {\n\t\t\"type\": \"boolean\"\n\t}\n};\nvar data1 = [true, false];\nvar data2 = [true, 123];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\nalert(\"data 2 error: \" + JSON.stringify(tv4.error, null, 4));\n</pre>\n</div>\n\n### Use of <code>$ref</code>\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo2\">\n<pre class=\"code\" id=\"demo2\">\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"#\"}\n};\nvar data1 = [[], [[]]];\nvar data2 = [[], [true, []]];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\n</pre>\n</div>\n\n### Missing schema\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo3\">\n<pre class=\"code\" id=\"demo3\">\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"http://example.com/schema\" }\n};\nvar data = [1, 2, 3];\n\nalert(\"Valid: \" + tv4.validate(data, schema)); // true\nalert(\"Missing schemas: \" + JSON.stringify(tv4.missing));\n</pre>\n</div>\n\n### Referencing remote schema\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo4\">\n<pre class=\"code\" id=\"demo4\">\ntv4.addSchema(\"http://example.com/schema\", {\n\t\"definitions\": {\n\t\t\"arrayItem\": {\"type\": \"boolean\"}\n\t}\n});\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"http://example.com/schema#/definitions/arrayItem\" }\n};\nvar data1 = [true, false, true];\nvar data2 = [1, 2, 3];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\n</pre>\n</div>\n\n## Supported platforms\n\n* Node.js\n* All modern browsers\n* IE >= 7\n\n## Installation\n\nYou can manually download [`tv4.js`](https://raw.github.com/geraintluff/tv4/master/tv4.js) or the minified [`tv4.min.js`](https://raw.github.com/geraintluff/tv4/master/tv4.min.js) and include it in your html to create the global `tv4` variable.\n\nAlternately use it as a CommonJS module:\n\n````js\nvar tv4 = require('tv4');\n````\n\n#### npm\n\n````\n$ npm install tv4\n````\n\n#### bower\n\n````\n$ bower install tv4\n````\n\n#### component.io\n\n````\n$ component install geraintluff/tv4\n````\n\n## Build and test\n\nYou can rebuild and run the node and browser tests using node.js and [grunt](http://http://gruntjs.com/):\n\nMake sure you have the global grunt cli command:\n````\n$ npm install grunt-cli -g\n````\n\nClone the git repos, open a shell in the root folder and install the development dependencies:\n\n````\n$ npm install\n````\n\nRebuild and run the tests:\n````\n$ grunt\n````\n\nIt will run a build and display one Spec-style report for the node.js and two Dot-style reports for both the plain and minified browser tests (via phantomJS). You can also use your own browser to manually run the suites by opening [`test/index.html`](http://geraintluff.github.io/tv4/test/index.html) and [`test/index-min.html`](http://geraintluff.github.io/tv4/test/index-min.html).\n\n## Contributing\n\nPull-requests for fixes and expansions are welcome. Edit the partial files in `/source` and add your tests in a suitable suite or folder under `/test/tests` and run `grunt` to rebuild and run the test suite. Try to maintain an idiomatic coding style and add tests for any new features. It is recommend to discuss big changes in an Issue.\n\n## Packages using tv4\n\n* [chai-json-schema](http://chaijs.com/plugins/chai-json-schema) is a [Chai Assertion Library](http://chaijs.com) plugin to assert values against json-schema.\n* [grunt-tv4](http://www.github.com/Bartvds/grunt-tv4) is a plugin for [Grunt](http://http://gruntjs.com/) that uses tv4 to bulk validate json files.\n\n## License\n\nThe code is available as \"public domain\", meaning that it is completely free to use, without any restrictions at all.  Read the full license [here](http://geraintluff.github.com/tv4/LICENSE.txt).\n\nIt's also available under an [MIT license](http://jsonary.com/LICENSE.txt).\n",
+  "readme": "# Tiny Validator (for v4 JSON Schema)\n\n[![Build Status](https://secure.travis-ci.org/geraintluff/tv4.png?branch=master)](http://travis-ci.org/geraintluff/tv4) [![Dependency Status](https://gemnasium.com/geraintluff/tv4.png)](https://gemnasium.com/geraintluff/tv4) [![NPM version](https://badge.fury.io/js/tv4.png)](http://badge.fury.io/js/tv4)\n\nUse [json-schema](http://json-schema.org/) [draft v4](http://json-schema.org/latest/json-schema-core.html) to validate simple values and complex objects using a rich [validation vocabulary](http://json-schema.org/latest/json-schema-validation.html) ([examples](http://json-schema.org/examples.html)).\n\nThere is support for `$ref` with JSON Pointer fragment paths (```other-schema.json#/properties/myKey```).\n\n## Usage 1: Simple validation\n\n```javascript\nvar valid = tv4.validate(data, schema);\n```\n\nIf validation returns ```false```, then an explanation of why validation failed can be found in ```tv4.error```.\n\nThe error object will look something like:\n```json\n{\n    \"code\": 0,\n    \"message\": \"Invalid type: string\",\n    \"dataPath\": \"/intKey\",\n    \"schemaKey\": \"/properties/intKey/type\"\n}\n```\n\nThe `\"code\"` property will refer to one of the values in `tv4.errorCodes` - in this case, `tv4.errorCodes.INVALID_TYPE`.\n\nTo enable external schema to be referenced, you use:\n```javascript\ntv4.addSchema(url, schema);\n```\n\nIf schemas are referenced (```$ref```) but not known, then validation will return ```true``` and the missing schema(s) will be listed in ```tv4.missing```. For more info see the API documentation below.\n\n## Usage 2: Multi-threaded validation\n\nStoring the error and missing schemas does not work well in multi-threaded environments, so there is an alternative syntax:\n\n```javascript\nvar result = tv4.validateResult(data, schema);\n```\n\nThe result will look something like:\n```json\n{\n    \"valid\": false,\n    \"error\": {...},\n    \"missing\": [...]\n}\n```\n\n## Usage 3: Multiple errors\n\nNormally, `tv4` stops when it encounters the first validation error.  However, you can collect an array of validation errors using:\n\n```javascript\nvar result = tv4.validateMultiple(data, schema);\n```\n\nThe result will look something like:\n```json\n{\n    \"valid\": false,\n    \"errors\": [\n        {...},\n        ...\n    ],\n    \"missing\": [...]\n}\n```\n\n## Asynchronous validation\n\nSupport for asynchronous validation (where missing schemas are fetched) can be added by including an extra JavaScript file.  Currently, the only version requires jQuery (`tv4.async-jquery.js`), but the code is very short and should be fairly easy to modify for other libraries (such as MooTools).\n\nUsage:\n\n```javascript\ntv4.validate(data, schema, function (isValid, validationError) { ... });\n```\n\n`validationFailure` is simply taken from `tv4.error`.\n\n## Cyclical JavaScript objects\n\nWhile they don't occur in proper JSON, JavaScript does support self-referencing objects. Any of the above calls support an optional third argument: `checkRecursive`. If true, tv4 will handle self-referencing objects properly - this slows down validation slightly, but that's better than a hanging script.\n\nConsider this data, notice how both `a` and `b` refer to each other:\n\n```javascript\nvar a = {};\nvar b = { a: a };\na.b = b;\nvar aSchema = { properties: { b: { $ref: 'bSchema' }}};\nvar bSchema = { properties: { a: { $ref: 'aSchema' }}};\ntv4.addSchema('aSchema', aSchema);\ntv4.addSchema('bSchema', bSchema);\n```\n\nIf the `checkRecursive` argument were missing, this would throw a \"too much recursion\" error. \n\nTo enable support for this, pass `true` as additional argument to any of the regular validation methods: \n\n```javascript\ntv4.validate(a, aSchema, true);\ntv4.validateResult(data, aSchema, true); \ntv4.validateMultiple(data, aSchema, true);\n```\n\n## The `banUnknownProperties` flag\n\nSometimes, it is desirable to flag all unknown properties as an error.  This is especially useful during development, to catch typos and the like, even when extra custom-defined properties are allowed.\n\nAs such, tv4 implements [\"ban unknown properties\" mode](https://github.com/json-schema/json-schema/wiki/ban-unknown-properties-mode-\\(v5-proposal\\)), enabled by a fourth-argument flag:\n\n```javascript\ntv4.validate(data, schema, checkRecursive, true);\ntv4.validateResult(data, schema, checkRecursive, true);\ntv4.validateMultiple(data, schema, checkRecursive, true);\n```\n\n## API\n\nThere are additional api commands available for more complex use-cases:\n\n##### addSchema(uri, schema)\nPre-register a schema for reference by other schema and synchronous validation.\n\n````js\ntv4.addSchema('http://example.com/schema', { ... });\n````\n\n* `uri` the uri to identify this schema.\n* `schema` the schema object.\n\nSchemas that have their `id` property set can be added directly.\n\n````js\ntv4.addSchema({ ... });\n````\n\n##### getSchema(uri)\n\nReturn a schema from the cache.\n\n* `uri` the uri of the schema (may contain a `#` fragment)\n\n````js\nvar schema = tv4.getSchema('http://example.com/schema');\n````\n\n##### getSchemaMap()\n\nReturn a shallow copy of the schema cache, mapping schema document URIs to schema objects.\n\n````\nvar map = tv4.getSchemaMap();\n\nvar schema = map[uri];\n````\n\n##### getSchemaUris(filter)\n\nReturn an Array with known schema document URIs.\n\n* `filter` optional RegExp to filter URIs\n\n````\nvar arr = tv4.getSchemaUris();\n\n// optional filter using a RegExp\nvar arr = tv4.getSchemaUris(/^https?://example.com/);\n````\n\n##### getMissingUris(filter)\n\nReturn an Array with schema document URIs that are used as `$ref` in known schemas but which currently have no associated schema data.\n\nUse this in combination with `tv4.addSchema(uri, schema)` to preload the cache for complete synchronous validation with.\n\n* `filter` optional RegExp to filter URIs\n\n````\nvar arr = tv4.getMissingUris();\n\n// optional filter using a RegExp\nvar arr = tv4.getMissingUris(/^https?://example.com/);\n````\n\n##### dropSchemas()\n\nDrop all known schema document URIs from the cache.\n\n````\ntv4.dropSchemas();\n````\n\n##### freshApi()\n\nReturn a new tv4 instance with no shared state.\n\n````\nvar otherTV4 = tv4.freshApi();\n````\n\n##### reset()\n\nManually reset validation status from the simple `tv4.validate(data, schema)`. Although tv4 will self reset on each validation there are some implementation scenarios where this is useful.\n\n````\ntv4.reset();\n````\n\n##### language(code)\n\nSelect the language map used for reporting.\n\n* `code` is a language code, like `'en'` or `'en-gb'`\n\n````\ntv4.language('en-gb');\n````\n\n##### addLanguage(code, map)\n\nAdd a new language map for selection by `tv4.language(code)`\n\n* `code` is new language code\n* `map` is an object mapping error IDs or constant names (e.g. `103` or `\"NUMBER_MAXIMUM\"`) to language strings.\n\n````\ntv4.addLanguage('fr', { ... });\n\n// select for use\ntv4.language('fr')\n````\n\n##### addFormat(format, validationFunction)\n\nAdd a custom format validator. (There are no built-in format validators.)\n\n* `format` is a string, corresponding to the `\"format\"` value in schemas.\n* `validationFunction` is a function that either returns:\n  * `null` (meaning no error)\n  * an error string (explaining the reason for failure)\n\n````\ntv4.addFormat('decimal-digits', function (data, schema) {\n\tif (typeof data === 'string' && !/^[0-9]+$/.test(data)) {\n\t\treturn null;\n\t}\n\treturn \"must be string of decimal digits\";\n});\n````\n\nAlternatively, multiple formats can be added at the same time using an object:\n````\ntv4.addFormat({\n\t'my-format': function () {...},\n\t'other-format': function () {...}\n});\n````\n\n## Demos\n\n### Basic usage\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo1\">\n<pre class=\"code\" id=\"demo1\">\nvar schema = {\n\t\"items\": {\n\t\t\"type\": \"boolean\"\n\t}\n};\nvar data1 = [true, false];\nvar data2 = [true, 123];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\nalert(\"data 2 error: \" + JSON.stringify(tv4.error, null, 4));\n</pre>\n</div>\n\n### Use of <code>$ref</code>\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo2\">\n<pre class=\"code\" id=\"demo2\">\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"#\"}\n};\nvar data1 = [[], [[]]];\nvar data2 = [[], [true, []]];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\n</pre>\n</div>\n\n### Missing schema\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo3\">\n<pre class=\"code\" id=\"demo3\">\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"http://example.com/schema\" }\n};\nvar data = [1, 2, 3];\n\nalert(\"Valid: \" + tv4.validate(data, schema)); // true\nalert(\"Missing schemas: \" + JSON.stringify(tv4.missing));\n</pre>\n</div>\n\n### Referencing remote schema\n<div class=\"content inline-demo\" markdown=\"1\" data-demo=\"demo4\">\n<pre class=\"code\" id=\"demo4\">\ntv4.addSchema(\"http://example.com/schema\", {\n\t\"definitions\": {\n\t\t\"arrayItem\": {\"type\": \"boolean\"}\n\t}\n});\nvar schema = {\n\t\"type\": \"array\",\n\t\"items\": {\"$ref\": \"http://example.com/schema#/definitions/arrayItem\" }\n};\nvar data1 = [true, false, true];\nvar data2 = [1, 2, 3];\n\nalert(\"data 1: \" + tv4.validate(data1, schema)); // true\nalert(\"data 2: \" + tv4.validate(data2, schema)); // false\n</pre>\n</div>\n\n## Supported platforms\n\n* Node.js\n* All modern browsers\n* IE >= 7\n\n## Installation\n\nYou can manually download [`tv4.js`](https://raw.github.com/geraintluff/tv4/master/tv4.js) or the minified [`tv4.min.js`](https://raw.github.com/geraintluff/tv4/master/tv4.min.js) and include it in your html to create the global `tv4` variable.\n\nAlternately use it as a CommonJS module:\n\n````js\nvar tv4 = require('tv4');\n````\n\n#### npm\n\n````\n$ npm install tv4\n````\n\n#### bower\n\n````\n$ bower install tv4\n````\n\n#### component.io\n\n````\n$ component install geraintluff/tv4\n````\n\n## Build and test\n\nYou can rebuild and run the node and browser tests using node.js and [grunt](http://http://gruntjs.com/):\n\nMake sure you have the global grunt cli command:\n````\n$ npm install grunt-cli -g\n````\n\nClone the git repos, open a shell in the root folder and install the development dependencies:\n\n````\n$ npm install\n````\n\nRebuild and run the tests:\n````\n$ grunt\n````\n\nIt will run a build and display one Spec-style report for the node.js and two Dot-style reports for both the plain and minified browser tests (via phantomJS). You can also use your own browser to manually run the suites by opening [`test/index.html`](http://geraintluff.github.io/tv4/test/index.html) and [`test/index-min.html`](http://geraintluff.github.io/tv4/test/index-min.html).\n\n## Contributing\n\nPull-requests for fixes and expansions are welcome. Edit the partial files in `/source` and add your tests in a suitable suite or folder under `/test/tests` and run `grunt` to rebuild and run the test suite. Try to maintain an idiomatic coding style and add tests for any new features. It is recommend to discuss big changes in an Issue.\n\n## Packages using tv4\n\n* [chai-json-schema](http://chaijs.com/plugins/chai-json-schema) is a [Chai Assertion Library](http://chaijs.com) plugin to assert values against json-schema.\n* [grunt-tv4](http://www.github.com/Bartvds/grunt-tv4) is a plugin for [Grunt](http://http://gruntjs.com/) that uses tv4 to bulk validate json files.\n\n## License\n\nThe code is available as \"public domain\", meaning that it is completely free to use, without any restrictions at all.  Read the full license [here](http://geraintluff.github.com/tv4/LICENSE.txt).\n\nIt's also available under an [MIT license](http://jsonary.com/LICENSE.txt).\n",
   "readmeFilename": "README.md",
   "bugs": {
@@ -65,5 +67,9 @@
   },
   "homepage": "https://github.com/geraintluff/tv4",
-  "_id": "tv4@1.0.11",
-  "_from": "tv4@"
+  "_id": "tv4@1.0.16",
+  "dist": {
+    "shasum": "f35372c01e94355b7aaff5860455fd231e2d9802"
+  },
+  "_from": "tv4@1.0.16",
+  "_resolved": "https://registry.npmjs.org/tv4/-/tv4-1.0.16.tgz"
 }
Index: Dev/trunk/src/node_modules/tv4/tv4.async-jquery.js
===================================================================
--- Dev/trunk/src/node_modules/tv4/tv4.async-jquery.js	(revision 486)
+++ Dev/trunk/src/node_modules/tv4/tv4.async-jquery.js	(revision 487)
@@ -4,14 +4,14 @@
 if (typeof (tv4.asyncValidate) === 'undefined') {
 	tv4.syncValidate = tv4.validate;
-	tv4.validate = function (data, schema, callback, checkRecursive) {
+	tv4.validate = function (data, schema, callback, checkRecursive, banUnknownProperties) {
 		if (typeof (callback) === 'undefined') {
-			return this.syncValidate(data, schema, checkRecursive);
+			return this.syncValidate(data, schema, checkRecursive, banUnknownProperties);
 		} else {
-			return this.asyncValidate(data, schema, callback, checkRecursive);
+			return this.asyncValidate(data, schema, callback, checkRecursive, banUnknownProperties);
 		}
 	};
-	tv4.asyncValidate = function (data, schema, callback, checkRecursive) {
+	tv4.asyncValidate = function (data, schema, callback, checkRecursive, banUnknownProperties) {
 		var $ = jQuery;
-		var result = tv4.validate(data, schema, checkRecursive);
+		var result = tv4.validate(data, schema, checkRecursive, banUnknownProperties);
 		if (!tv4.missing.length) {
 			callback(result, tv4.error);
@@ -28,5 +28,5 @@
 			// When all requests done, try again
 			$.when.apply($, missingSchemas).done(function () {
-				var result = tv4.asyncValidate(data, schema, callback, checkRecursive);
+				var result = tv4.asyncValidate(data, schema, callback, checkRecursive, banUnknownProperties);
 			});
 		}
Index: Dev/trunk/src/node_modules/tv4/tv4.js
===================================================================
--- Dev/trunk/src/node_modules/tv4/tv4.js	(revision 486)
+++ Dev/trunk/src/node_modules/tv4/tv4.js	(revision 487)
@@ -133,5 +133,7 @@
 		this.scannedFrozen = [];
 		this.scannedFrozenSchemas = [];
-		this.key = 'tv4_validation_id';
+		this.scannedFrozenValidationErrors = [];
+		this.validatedSchemasKey = 'tv4_validation_id';
+		this.validationErrorsKey = 'tv4_validation_errors_id';
 	}
 	if (trackUnknownProperties) {
@@ -240,12 +242,12 @@
 };
 ValidatorContext.prototype.searchSchemas = function (schema, url) {
-	if (typeof schema.id === "string") {
-		if (isTrustedUrl(url, schema.id)) {
-			if (this.schemas[schema.id] === undefined) {
-				this.schemas[schema.id] = schema;
-			}
-		}
-	}
-	if (typeof schema === "object") {
+	if (schema && typeof schema === "object") {
+		if (typeof schema.id === "string") {
+			if (isTrustedUrl(url, schema.id)) {
+				if (this.schemas[schema.id] === undefined) {
+					this.schemas[schema.id] = schema;
+				}
+			}
+		}
 		for (var key in schema) {
 			if (key !== "enum") {
@@ -264,5 +266,5 @@
 ValidatorContext.prototype.addSchema = function (url, schema) {
 	//overload
-	if (typeof schema === 'undefined') {
+	if (typeof url !== 'string' || typeof schema === 'undefined') {
 		if (typeof url === 'object' && typeof url.id === 'string') {
 			schema = url;
@@ -331,11 +333,24 @@
 	}
 
-	if (this.checkRecursive && (typeof data) === 'object') {
+	var startErrorCount = this.errors.length;
+	var frozenIndex, scannedFrozenSchemaIndex = null, scannedSchemasIndex = null;
+	if (this.checkRecursive && data && typeof data === 'object') {
 		topLevel = !this.scanned.length;
-		if (data[this.key] && data[this.key].indexOf(schema) !== -1) { return null; }
-		var frozenIndex;
+		if (data[this.validatedSchemasKey]) {
+			var schemaIndex = data[this.validatedSchemasKey].indexOf(schema);
+			if (schemaIndex !== -1) {
+				this.errors = this.errors.concat(data[this.validationErrorsKey][schemaIndex]);
+				return null;
+			}
+		}
 		if (Object.isFrozen(data)) {
 			frozenIndex = this.scannedFrozen.indexOf(data);
-			if (frozenIndex !== -1 && this.scannedFrozenSchemas[frozenIndex].indexOf(schema) !== -1) { return null; }
+			if (frozenIndex !== -1) {
+				var frozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].indexOf(schema);
+				if (frozenSchemaIndex !== -1) {
+					this.errors = this.errors.concat(this.scannedFrozenValidationErrors[frozenIndex][frozenSchemaIndex]);
+					return null;
+				}
+			}
 		}
 		this.scanned.push(data);
@@ -346,9 +361,15 @@
 				this.scannedFrozenSchemas.push([]);
 			}
-			this.scannedFrozenSchemas[frozenIndex].push(schema);
+			scannedFrozenSchemaIndex = this.scannedFrozenSchemas[frozenIndex].length;
+			this.scannedFrozenSchemas[frozenIndex][scannedFrozenSchemaIndex] = schema;
+			this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = [];
 		} else {
-			if (!data[this.key]) {
+			if (!data[this.validatedSchemasKey]) {
 				try {
-					Object.defineProperty(data, this.key, {
+					Object.defineProperty(data, this.validatedSchemasKey, {
+						value: [],
+						configurable: true
+					});
+					Object.defineProperty(data, this.validationErrorsKey, {
 						value: [],
 						configurable: true
@@ -356,8 +377,11 @@
 				} catch (e) {
 					//IE 7/8 workaround
-					data[this.key] = [];
-				}
-			}
-			data[this.key].push(schema);
+					data[this.validatedSchemasKey] = [];
+					data[this.validationErrorsKey] = [];
+				}
+			}
+			scannedSchemasIndex = data[this.validatedSchemasKey].length;
+			data[this.validatedSchemasKey][scannedSchemasIndex] = schema;
+			data[this.validationErrorsKey][scannedSchemasIndex] = [];
 		}
 	}
@@ -376,5 +400,5 @@
 		while (this.scanned.length) {
 			var item = this.scanned.pop();
-			delete item[this.key];
+			delete item[this.validatedSchemasKey];
 		}
 		this.scannedFrozen = [];
@@ -391,4 +415,10 @@
 			this.prefixErrors(errorCount, dataPart, schemaPart);
 		}
+	}
+	
+	if (scannedFrozenSchemaIndex !== null) {
+		this.scannedFrozenValidationErrors[frozenIndex][scannedFrozenSchemaIndex] = this.errors.slice(startErrorCount);
+	} else if (scannedSchemasIndex !== null) {
+		data[this.validationErrorsKey][scannedSchemasIndex] = this.errors.slice(startErrorCount);
 	}
 
@@ -996,11 +1026,11 @@
 }
 function normSchema(schema, baseUri) {
-	if (baseUri === undefined) {
-		baseUri = schema.id;
-	} else if (typeof schema.id === "string") {
-		baseUri = resolveUrl(baseUri, schema.id);
-		schema.id = baseUri;
-	}
-	if (typeof schema === "object") {
+	if (schema && typeof schema === "object") {
+		if (baseUri === undefined) {
+			baseUri = schema.id;
+		} else if (typeof schema.id === "string") {
+			baseUri = resolveUrl(baseUri, schema.id);
+			schema.id = baseUri;
+		}
 		if (Array.isArray(schema)) {
 			for (var i = 0; i < schema.length; i++) {
@@ -1050,5 +1080,5 @@
 	FORMAT_CUSTOM: 500,
 	// Schema structure
-	CIRCULAR_REFERENCE: 500,
+	CIRCULAR_REFERENCE: 600,
 	// Non-standard validation options
 	UNKNOWN_PROPERTY: 1000
@@ -1091,14 +1121,29 @@
 
 function ValidationError(code, message, dataPath, schemaPath, subErrors) {
+	Error.call(this);
 	if (code === undefined) {
 		throw new Error ("No code supplied for error: "+ message);
 	}
+	this.message = message;
 	this.code = code;
-	this.message = message;
 	this.dataPath = dataPath || "";
 	this.schemaPath = schemaPath || "";
 	this.subErrors = subErrors || null;
-}
-ValidationError.prototype = new Error();
+
+	var err = new Error(this.message);
+	this.stack = err.stack || err.stacktrace;
+	if (!this.stack) {
+		try {
+			throw err;
+		}
+		catch(err) {
+			this.stack = err.stack || err.stacktrace;
+		}
+	}
+}
+ValidationError.prototype = Object.create(Error.prototype);
+ValidationError.prototype.constructor = ValidationError;
+ValidationError.prototype.name = 'ValidationError';
+
 ValidationError.prototype.prefixWith = function (dataPrefix, schemaPrefix) {
 	if (dataPrefix !== null) {
@@ -1265,4 +1310,2 @@
 
 })(this);
-
-//@ sourceMappingURL=tv4.js.map
Index: Dev/trunk/src/package.json
===================================================================
--- Dev/trunk/src/package.json	(revision 486)
+++ Dev/trunk/src/package.json	(revision 487)
@@ -4,5 +4,5 @@
   "description": "QED Server",
   "dependencies": {
-    "express": "~3.2.3",
+    "express": "~3.2.6",
     "underscore": "~1.4.4",
     "passport": "~0.1.17",
@@ -11,5 +11,5 @@
     "request": "~2.21.0",
     "ya-csv": "~0.9.2",
-    "tv4": "~1.0.11"
+    "tv4": "~1.0.16"
   },
   "engines": {
Index: Dev/trunk/src/server/app.js
===================================================================
--- Dev/trunk/src/server/app.js	(revision 486)
+++ Dev/trunk/src/server/app.js	(revision 487)
@@ -9,4 +9,7 @@
   , _ = require("underscore")
   , tv4 = require("tv4")
+  , HTTPResult = require("./util/http-result")
+  , etags = require("./util/etags")
+  , cryptoken = require('./util/crypto-token')
   ;
 
@@ -22,6 +25,7 @@
 exports.App = function(settings) {
 
-    assertSetting("couchDbURL", settings, _.isString);
-    var couch = new CouchDB(settings.couchDbURL);
+    assertSetting("couchServerURL", settings, _.isString);
+    assertSetting("dbName", settings, _.isString);
+    var couch = new CouchDB(settings.couchServerURL,settings.dbName);
     
     var schema = require("./config/couchdb-schema.json");
@@ -69,4 +73,6 @@
     app.use(passport.initialize());
     app.use(passport.session());
+    
+    // various middlewares
     function ensureAuthenticated(req,res,next){
         if (!req.user) {
@@ -78,4 +84,7 @@
     function returnUser(req,res) {
         res.send(200, req.user);
+    }
+    function notImplemented(req,res) {
+        res.send(501,{error:"API not implemented yet."});
     }
 
@@ -112,168 +121,669 @@
         });
 
+    var JSON_MIME = 'application/json';
+    var CSV_MIME = 'application/json';
+    function ensureMIME(mimeType) {
+        return function(req,res,next) {
+            if (!req.accepts(mimeType)) {
+                res.send(406);
+            } else {
+                res.set({
+                    'Content-Type': mimeType
+                });
+                next();
+            }
+        };
+    }
+    
+    function stripAndReturnPrivates(obj) {
+        var priv = {};
+        _.each(obj||{},function(val,key){
+            if (key.substring(0,1) === '_') {
+                priv[key] = val;
+                delete obj[key];
+            }
+        });
+        return priv;
+    }
+
+    function identity(obj) { return obj; }
+    function handleUnknownResponse(status,error){
+        return new HTTPResult(500,{error: "Unexpected database response",
+                                   innerStatus: status, innerResponse: error});
+    }
+    function handleUnknownError(error){
+        return new HTTPResult(500, {error: "Unknown error", innerError: error});
+    }
+    function handleRowValues(result) {
+        return _.map(result.rows, function(item) { return item.value; });
+    }
+    function handleRowDocs(result) {
+        return _.map(result.rows, function(item) { return item.doc; });
+    }
+
+    function getDocumentsOfType (type) {
+        var url = '_design/default/_view/by_type?key='+JSON.stringify(type);
+        return HTTPResult.fromResponsePromise(couch.get(url).response,
+                                              handleUnknownError)
+        .handle({
+            200: handleRowValues,
+            404: function() { return {error: "Cannot find collection of type "+type}; },
+            default: handleUnknownResponse
+        });
+    }
+    function getDocument(id,rev,type) {
+        var opts = {headers:{}};
+        if (rev) {
+            opts.headers['If-Non-Match'] = '"'+rev+'"';
+        }
+        return HTTPResult.fromResponsePromise(couch.get(id,opts).response,
+                                              handleUnknownError)
+        .handle({
+            200: function(doc){
+                if ( doc.type !== type ) {
+                    return new HTTPResult(404,{error:"Document not found."});
+                } else {
+                    var priv = stripAndReturnPrivates(doc);
+                    if ( priv._rev !== rev ) {
+                        doc._id = priv._id;
+                        doc._rev = priv._rev;
+                        return doc;
+                    } else {
+                        return new HTTPResult(304);
+                    }
+                }
+            },
+            304: identity,
+            default: handleUnknownResponse
+        });
+    }
+    function putDocument(id,rev,type,doc) {
+        var priv = stripAndReturnPrivates(doc);
+        if ( doc.type === type && tv4.validateResult(doc, schema) ) {
+            var opts = rev ? {headers:{'If-Match':'"'+rev+'"'}} : {};
+            return HTTPResult.fromResponsePromise(couch.put(id,doc,opts).response,
+                                                  handleUnknownError)
+            .handle({
+                201: function(res){
+                    doc._id = res.id;
+                    doc._rev = res.rev;
+                    return doc;
+                },
+                409: function(error) {
+                    return {error: error.reason};
+                },
+                default: handleUnknownResponse
+            });
+        } else {
+            return new HTTPResult(400,{error: "Document failed schema verification."});
+        }
+    }
+    function deleteDocument(id,rev) {
+        if ( rev ) {
+            var opts = {headers:{'If-Match':'"'+rev+'"'}};
+            return HTTPResult.fromResponsePromise(couch.delete(id,opts).response,
+                                                  handleUnknownError)
+            .handle({
+                200: identity,
+                409: function(error) {
+                    return {error: error.reason};
+                },
+                default: handleUnknownResponse
+            });
+        } else {
+            return new HTTPResult(409, {error: "Cannot identify document revision to delete."});
+        }
+    }
+    function postDocument(type,doc) {
+        var priv = stripAndReturnPrivates(doc);
+        if ( doc.type === type && tv4.validateResult(doc, schema) ) {
+            return HTTPResult.fromResponsePromise(couch.post(doc).response,
+                                                  handleUnknownError)
+            .handle({
+                201: function(response) {
+                    doc._id = response.id;
+                    doc._rev = response.rev;
+                    return doc;
+                },
+                default: handleUnknownResponse
+            });
+        } else {
+            return new HTTPResult(400,{error: "Document failed schema verification."});
+        }
+    }
+
     function makeDocsGet(type) {
         return function(req,res) {
-            var url = '_design/default/_view/by_type?key='+JSON.stringify(type);
-            couch.get(url).then(function(result){
-                var items = _.map(result.rows, function(item) { return item.value; });
-                res.send(200, items);
-            }, function(error){
-                res.send(404, {error: "Cannot find collection"});
+            getDocumentsOfType(type)
+            .handle(res.send.bind(res));
+        };
+    }
+    function makeDocGet_id(type) {
+        return function(req,res) {
+            var id = req.params.id;
+            var rev = etags.parse(req.header('If-Non-Match'))[0];
+            getDocument(id,rev,type)
+            .handle({
+                200: function(doc){
+                    res.set({
+                        'ETag': etags.format([doc._rev])
+                    }).send(200, doc);
+                },
+                default: res.send.bind(res)
             });
         };
     }
-    function makeDocGet_id(type) {
+    function makeDocPut_id(type) {
         return function(req,res) {
             var id = req.params.id;
-            couch.get(id).then(function(result){
-                if ( result.type === type ) {
-                    res.send(200, result);
-                } else {
-                    res.send(404, {error: "Document "+id+" is not a "+type});
-                }
-            }, function(error){
-                res.send(404, {error: "Cannot find survey run "+id});
+            var doc = req.body;
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            putDocument(id,rev,type,doc)
+            .handle({
+                201: function(doc) {
+                    res.set({
+                        'ETag': etags.format([doc._rev])
+                    }).send(201, doc);
+                },
+                default: res.send.bind(res)
             });
         };
     }
-    function makeDocPut_id(type) {
+    function makeDocDel_id(type) {
         return function(req,res) {
             var id = req.params.id;
             var doc = req.body;
-            if ( doc.type === type && tv4.validateResult(doc, schema) ) {
-                couch.put(id,doc).then(function(result){
-                    res.send(200, result);
-                }, function(error){
-                    res.send(500, error);
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            deleteDocument(id,rev)
+            .handle(res.send.bind(res));
+        };
+    }
+    function makeDocPost(type) {
+        return function(req,res) {
+            var doc = req.body;
+            postDocument(type,doc)
+            .handle({
+                201: function(doc) {
+                    res.set({
+                        'ETag': etags.format([doc._rev])
+                    }).send(201, doc);
+                },
+                default: res.send.bind(res)
+            });
+        };
+    }
+
+    // Questions
+    function getQuestionsWithCode(code) {
+        var url = '_design/questions/_view/by_code';
+        var query = {include_docs:true,key:code};
+        return HTTPResult.fromResponsePromise(couch.get(url,{query:query}).response,
+                                              handleUnknownError)
+        .handle({
+            200: handleRowDocs,
+            default: handleUnknownResponse
+        });
+    }
+    function getQuestionsWithTopic(topic) {
+        var url = '_design/questions/_view/all_topics';
+        var query = {reduce:false,include_docs:true,key:topic};
+        return HTTPResult.fromResponsePromise(couch.get(url,{query:query}).response,
+                                              handleUnknownError)
+        .handle({
+            200: handleRowDocs,
+            default: handleUnknownResponse
+        });
+    }
+    function getQuestionsWithCategoryAndTopic(category,topic) {
+        var hasTopic = typeof topic !== 'undefined';
+        var url = '_design/questions/_view/all';
+        var query = {reduce:false,include_docs:true,
+                     startkey:hasTopic?[category,topic]:[category],
+                     endkey:hasTopic?[category,topic]:[category,{}]};
+        return HTTPResult.fromResponsePromise(couch.get(url,{query:query}).response,
+                                              handleUnknownError)
+        .handle({
+            200: handleRowDocs,
+            default: handleUnknownResponse
+        });
+    }
+    app.get('/api/questions',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var hr;
+            if ( 'category' in req.query ) {
+                hr = getQuestionsWithCategoryAndTopic(req.query.category,req.query.topic);
+            } else if ( 'topic' in req.query ) {
+                hr = getQuestionsWithTopic(req.query.topic);
+            } else if ( 'code' in req.query ) {
+                hr = getQuestionsWithCode(req.query.code);
+            }
+            hr.handle(res.send.bind(res));
+        });
+    app.post('/api/questions',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function (req,res) {
+            var doc = req.body;
+            getQuestionsWithCode(doc.code)
+            .handle({
+                200: function(others) {
+                    if ( others.length > 0 ) {
+                        return new HTTPResult(403,{error:"Other question with this code already exists."});
+                    } else {
+                        return postDocument('Question',doc);
+                    }
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.get('/api/questions/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocGet_id('Question'));
+    app.put('/api/questions/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function (req,res) {
+            var id = req.params.id;
+            var doc = req.body;
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            getQuestionsWithCode(doc.code)
+            .handle({
+                200: function(others) {
+                    if ( others.length > 0 ) {
+                        return new HTTPResult(403,{error:"Other question with this code already exists."});
+                    } else {
+                        return putDocument(id,rev,'Question',doc);
+                    }
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.delete('/api/questions/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocDel_id('Question'));
+
+
+    // Categories and topics
+    app.get('/api/categories',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var url = '_design/questions/_view/all';
+            HTTPResult.fromResponsePromise(couch.get(url,{query:{reduce:true,group:true,group_level:1}}).response,
+                                           handleUnknownError)
+            .handle({
+                200: function(result) {
+                    return _.map(result.rows, function(item) {
+                        return { name:item.key[0], count:item.value };
+                    });
+                },
+                default: handleUnknownResponse
+            })
+            .handle(res.send.bind(res));
+        });
+    app.get('/api/categories/:category/topics',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var category = req.params.category;
+            var url = '_design/questions/_view/all';
+            HTTPResult.fromResponsePromise(couch.get(url,{query:{reduce:true,group:true,group_level:2,startkey:[category],endkey:[category,{}]}}).response,
+                                           handleUnknownError)
+            .handle({
+                200: function(result) {
+                    return _.map(result.rows, function(item) { return { name:item.key[1], count:item.value }; });
+                },
+                default: handleUnknownResponse
+            })
+            .handle(res.send.bind(res));
+        });
+    app.get('/api/topics',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var url = '_design/questions/_view/all_topics';
+            HTTPResult.fromResponsePromise(couch.get(url,{query:{reduce:true,group:true}}).response,
+                                           handleUnknownError)
+            .handle({
+                200: function(result) {
+                    return _.map(result.rows, function(item) { return {name:item.key, count:item.value}; });
+                },
+                default: handleUnknownResponse
+            })
+            .handle(res.send.bind(res));
+        });
+
+    // Surveys
+    app.get('/api/surveys',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var url;
+            if ( 'drafts' in req.query ) {
+                url = '_design/surveys/_view/drafts';
+            } else if ( 'published' in req.query ) {
+                url = '_design/surveys/_view/published';
+            } else {
+                url = '_design/default/_view/by_type?key='+JSON.stringify('Survey');
+            }
+            HTTPResult.fromResponsePromise(couch.get(url).response,
+                                           handleUnknownError)
+            .handle({
+                200: function(result) {
+                    return _.map(result.rows, function(item) { return item.value; });
+                },
+                default: handleUnknownResponse
+            })
+            .handle(res.send.bind(res));
+        });
+    app.post('/api/surveys',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocPost('Survey'));
+    app.get('/api/surveys/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocGet_id('Survey'));
+    app.put('/api/surveys/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocPut_id('Survey'));
+    app.delete('/api/surveys/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocDel_id('Survey'));
+
+    // SurveyRuns
+    app.get('/api/surveyRuns',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocsGet('SurveyRun'));
+    app.post('/api/surveyRuns',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var doc = req.body;
+            randomToken()
+            .handle({
+                201: function(token) {
+                    doc.secret = token;
+                    return postDocument('SurveyRun',doc);
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.get('/api/surveyRuns/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocGet_id('SurveyRun'));
+    app.put('/api/surveyRuns/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function (req,res) {
+            var id = req.params.id;
+            var doc = req.body;
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            var hr;
+            if ( typeof doc.secret === 'undefined' ) {
+                hr = randomToken()
+                .handle({
+                    201: function(token) {
+                        doc.secret = token;
+                        return putDocument(id,rev,'SurveyRun',doc);
+                    }
                 });
             } else {
-                res.send(400,{error: "Document failed schema verification."});
+                hr = putDocument(id,rev,'SurveyRun',doc);
             }
-        };
-    }
-    function makeDocDel_id(type) {
-        return function(req,res) {
-            var id = req.params.id;
-            var rev = req.query.rev;
-            couch.delete(id,rev).then(function(result){
-                res.send(200, result);
-            }, function(error){
-                res.send(500, error);
+            hr.handle(res.send.bind(res));
+        });
+    app.delete('/api/surveyRuns/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocDel_id('SurveyRun'));
+    app.get('/api/surveyRuns/:id/responses',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var id = req.params.id;
+            getResponsesBySurveyRunId(id)
+            .handle(res.send.bind(res));
+        });
+    app.get('/api/surveyRuns/:id/responses.csv',
+        ensureAuthenticated,
+        ensureMIME(CSV_MIME),
+        function(req, res) {
+            var id = req.params.id;
+            getResponsesBySurveyRunId(id)
+            .handle({
+                200: function(responses) {
+                    var flatResponses = responsesToVariables(responses);
+                    res.set({
+                        'Content-Disposition': 'attachment; filename=surveyRun-'+id+'-responses.csv'
+                    });
+                    res.status(200);
+                    writeObjectsToCSVStream(flatResponses, res);
+                    res.end();
+                },
+                default: res.send.bind(res)
             });
-        };
-    }
-    function makeDocPost(type) {
-        return function(req,res) {
-            var doc = req.body;
-            if ( doc.type === type && tv4.validateResult(doc, schema) ) {
-                couch.post(req.body).then(function(result){
-                    res.send(200, result);
-                }, function(error){
-                    res.send(500, error);
+        });
+    
+    // Responses
+    function getResponsesBySurveyRunId(surveyRunId) {
+        var url = '_design/responses/_view/by_surveyrun?key='+JSON.stringify(surveyRunId);
+        return HTTPResult.fromResponsePromise(couch.get(url).response,
+                                              handleUnknownError)
+        .handle({
+            200: handleRowValues,
+            default: handleUnknownResponse
+        });
+    }
+    app.get('/api/responses',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res){
+            var hr;
+            if ( 'surveyRunId' in req.query ) {
+                hr = getResponsesBySurveyRunId(req.query.surveyRunId);
+            } else {
+                hr = getDocumentsOfType('Response');
+            }
+            hr.handle(res.send.bind(res));
+        });
+    app.get('/api/responses/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocGet_id('Response'));
+    app.post('/api/responses',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function (req,res) {
+            var doc = req.body;
+            randomToken()
+            .handle({
+                201: function(token) {
+                    doc.secret = token;
+                    return postDocument('Response',doc);
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.put('/api/responses/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function (req,res) {
+            var id = req.params.id;
+            var doc = req.body;
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            var hr;
+            if ( typeof doc.secret === 'undefined' ) {
+                hr = randomToken()
+                .handle({
+                    201: function(token) {
+                        doc.secret = token;
+                        return putDocument(id,rev,'Response',doc);
+                    }
                 });
             } else {
-                res.send(400,{error: "Document failed schema verification."});
+                hr = putDocument(id,rev,'Response',doc);
             }
-        };
-    }
-    function notImplemented(req,res) {
-        res.send(501,{error:"API not implemented yet."});
-    }
-
-    // Questions
-    app.get('/api/questions',
-        ensureAuthenticated,
-        makeDocsGet('Question'));
-    app.get('/api/questions/:id',
-        ensureAuthenticated,
-        makeDocGet_id('Question'));
-    app.post('/api/questions',
-        ensureAuthenticated,
-        makeDocPost('Question'));
-    app.put('/api/questions/:id',
-        ensureAuthenticated,
-        makeDocPut_id('Question'));
-    app.delete('/api/questions/:id',
-        ensureAuthenticated,
-        makeDocDel_id('Question'));
-    app.get('/api/questions/categories',
-        ensureAuthenticated,
-        notImplemented);
-
-    // Surveys
-    app.get('/api/surveys',
-        ensureAuthenticated,
-        makeDocsGet('Survey'));
-    app.get('/api/surveys/:id',
-        ensureAuthenticated,
-        makeDocGet_id('Survey'));
-    app.post('/api/surveys',
-        ensureAuthenticated,
-        makeDocPost('Survey'));
-    app.put('/api/surveys/:id',
-        ensureAuthenticated,
-        makeDocPut_id('Survey'));
-    app.delete('/api/surveys/:id',
-        ensureAuthenticated,
-        makeDocDel_id('Survey'));
-
-    // SurveyRuns
-    app.get('/api/surveyRuns',
-        ensureAuthenticated,
-        makeDocsGet('SurveyRun'));
-    app.get('/api/surveyRuns/:id',
-        ensureAuthenticated,
-        makeDocGet_id('SurveyRun'));
-    app.get('/api/surveyRuns/:id/responses.csv',
-        ensureAuthenticated,
-        function(req, res) {
-            var id = req.params.id;
-            var url = '_design/responses/_view/by_surveyrun?key='+JSON.stringify(id);
-            couch.get(url).then(function(result){
-                var responses = _.map(result.rows, function(item) { return item.value; });
-                var flatResponses = responsesToVariables(responses);
-                res.set({
-                    'Content-Type': 'text/csv',
-                    'Content-Disposition': 'attachment; filename=surveyRun-'+id+'-responses.csv'
-                });
-                res.status(200);
-                writeObjectsToCSVStream(flatResponses, res);
-                res.end();
-            }, function(error){
-                res.send(404, {error: "Cannot find responses for survey run "+id});
-            });
-        });
-    app.get('/api/surveyRuns/:id/responses',
-        ensureAuthenticated,
+            hr.handle(res.send.bind(res));
+        });
+    app.delete('/api/responses/:id',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        makeDocDel_id('Response'));
+
+    //respondents api
+    function isSurveyRunRunning(surveyRun) {
+        var now = new Date();
+        var afterStart = !surveyRun.startDate || now >= new Date(surveyRun.startDate);
+        var beforeEnd = !surveyRun.endDate || now <= new Date(surveyRun.endDate);
+        return afterStart && beforeEnd;
+    }
+    app.get('/api/open/responses/:id',
+        ensureMIME(JSON_MIME),
         function(req,res) {
             var id = req.params.id;
-            var url = '_design/responses/_view/by_surveyrun?key='+JSON.stringify(id);
-            couch.get(url).then(function(result){
-                var responses = _.map(result.rows, function(item) { return item.value; });
-                res.send(200, responses);
-            }, function(error){
-                res.send(404, {error: "Cannot find responses for survey run "+id});
-            });
-        });
-    
-    // Responses
-    app.get('/api/responses',
-        ensureAuthenticated,
-        makeDocsGet('Response'));
-    app.get('/api/responses/:id',
-        ensureAuthenticated,
-        makeDocGet_id('Response'));
-    app.post('/api/responses',
-        ensureAuthenticated,
-        makeDocPost('Response'));
-    app.put('/api/responses/:id',
-        ensureAuthenticated,
-        makeDocPut_id('Response'));
-    app.delete('/api/responses/:id',
-        ensureAuthenticated,
-        makeDocDel_id('Response'));
+            var rev = etags.parse(req.header('If-Non-Match'))[0];
+            var secret = req.query.secret;
+            getDocument(id,rev,'Response')
+            .handle({
+                200: function(response) {
+                    if ( response.secret === secret ) {
+                        return getDocument(response.surveyRunId,[],'SurveyRun')
+                        .handle({
+                            200: function(surveyRun) {
+                                if ( !isSurveyRunRunning(surveyRun) ) {
+                                    return new HTTPResult(404,{error:"Survey is not running anymore."});
+                                } else {
+                                    response._surveyRun = surveyRun;
+                                    return response;
+                                }
+                            }
+                        });
+                    } else {
+                        return new HTTPResult(403,{error: "Wrong secret for response"});
+                    }
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.post('/api/open/responses',
+        ensureMIME(JSON_MIME),
+        function(req,res) {
+            var secret = req.query.secret;
+            var response = req.body;
+            delete response._surveyRun;
+            getDocument(response.surveyRunId,[],'SurveyRun')
+            .handle({
+                200: function(surveyRun) {
+                    if ( surveyRun.secret !== secret ) {
+                        return new HTTPResult(403,{error:"Wrong secret for surveyRun."});
+                    } else if ( !isSurveyRunRunning(surveyRun) ) {
+                        return new HTTPResult(404,{error:"Survey is not running anymore."});
+                    } else if ( surveyRun.mode === 'closed' ) {
+                        return new HTTPResult(403,{error:"Survey is closed and doesn't allow new responses."});
+                    } else {
+                        return randomToken()
+                        .handle({
+                            201: function(token) {
+                                response.secret = token;
+                                return postDocument('Response',response)
+                                .handle({
+                                    201: function(doc){
+                                        doc._surveyRun = surveyRun;
+                                        return doc;
+                                    }
+                                });
+                            }
+                        });
+                    }
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.put('/api/open/responses/:id',
+        ensureMIME(JSON_MIME),
+        function(req,res){
+            var id = req.params.id;
+            var doc = req.body;
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            var secret = req.query.secret || doc.secret;
+            delete doc._surveyRun;
+            getDocument(id,[],'Response')
+            .handle({
+                200: function(prev) {
+                    if ( prev.secret !== secret ) {
+                        return new HTTPResult(403,{error: "Secrets are not the same."});
+                    } else if ( prev.surveyRunId !== doc.surveyRunId ) {
+                        return new HTTPResult(400,{error:"Response cannot change it's surveyRunId."});
+                    } else {
+                        doc.secret = secret; // restore in case it got lost or was changed
+                        return getDocument(doc.surveyRunId,[],'SurveyRun')
+                        .handle({
+                            200: function(surveyRun) {
+                                if ( !isSurveyRunRunning(surveyRun) ) {
+                                    return new HTTPResult(404,{error:"Survey is not running anymore."});
+                                } else {
+                                    return putDocument(id,rev,'Response',doc)
+                                    .handle({
+                                        200: function(doc) {
+                                            doc._surveyRun = surveyRun;
+                                            return new HTTPResult(201,doc);
+                                        }
+                                    });
+                                }
+                            }
+                        });
+                    }
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+    app.delete('/api/open/responses/:id',
+        ensureMIME(JSON_MIME),
+        function(req,res){
+            var id = req.params.id;
+            var doc = req.body;
+            var rev = etags.parse(req.header('If-Match'))[0] || (doc && doc._rev);
+            var secret = req.query.secret || doc.secret;
+            delete doc._surveyRun;
+            getDocument(id,[],'Response')
+            .handle({
+                200: function(prev) {
+                    if ( prev.secret !== secret ) {
+                        return new HTTPResult(403,{error: "Secrets are not the same."});
+                    } else {
+                        return deleteDocument(id,rev,doc);
+                    }
+                }
+            })
+            .handle(res.send.bind(res));
+        });
+
+    // uuids
+    app.get('/api/uuids',
+        ensureAuthenticated,
+        ensureMIME(JSON_MIME),
+        function(req,res){
+            var count = (req.query.count && parseInt(req.query.count,10)) || 1;
+            HTTPResult.fromResponsePromise(couch.uuids({query:{count:count}}).response,
+                                           handleUnknownError)
+            .handle({
+                200: function(res) {
+                    return res.uuids;
+                },
+                default: handleUnknownResponse
+            })
+            .handle(res.send.bind(res));
+        });
 
     return app;
-
 }
 
@@ -341,2 +851,13 @@
     });
 }
+
+function randomToken() {
+    var result = new HTTPResult();
+    cryptoken(8)
+    .then(function(token){
+        result.set(201,token);
+    }, function(ex){
+        result.set(500,{error:"Cannot generate secrets.", innerError: ex});
+    });
+    return result;
+}
Index: Dev/trunk/src/server/bin/check-db.js
===================================================================
--- Dev/trunk/src/server/bin/check-db.js	(revision 486)
+++ Dev/trunk/src/server/bin/check-db.js	(revision 487)
@@ -1,5 +1,6 @@
 var env = require('../env')
-  , checkCouch = require('../config/check-couchdb');
-checkCouch(env.couchDbURL)
+  , checkCouch = require('../config/check-couchdb')
+  ;
+checkCouch(env.couchServerURL,env.dbName)
 .then(function(res){
     console.log("done",res);
Index: Dev/trunk/src/server/bin/config-db-for-upgrade.js
===================================================================
--- Dev/trunk/src/server/bin/config-db-for-upgrade.js	(revision 487)
+++ Dev/trunk/src/server/bin/config-db-for-upgrade.js	(revision 487)
@@ -0,0 +1,10 @@
+var env = require('../env')
+  , configCouch = require('../config/config-couchdb')
+  , designDocs = require('../config/couchdb-upgrade-design-docs')
+  ;
+configCouch(env.couchServerURL,env.dbName,designDocs)
+.then(function(res){
+    console.log("done",res);
+}, function(err){
+    console.error("fail",err);
+});
Index: Dev/trunk/src/server/bin/config-db.js
===================================================================
--- Dev/trunk/src/server/bin/config-db.js	(revision 486)
+++ Dev/trunk/src/server/bin/config-db.js	(revision 487)
@@ -1,5 +1,7 @@
 var env = require('../env')
-  , checkCouch = require('../config/config-couchdb');
-checkCouch(env.couchServerURL)
+  , configCouch = require('../config/config-couchdb')
+  , designDocs = require('../config/couchdb-design-docs')
+  ;
+configCouch(env.couchServerURL,env.dbName,designDocs)
 .then(function(res){
     console.log("done",res);
Index: Dev/trunk/src/server/bin/heroku.js
===================================================================
--- Dev/trunk/src/server/bin/heroku.js	(revision 486)
+++ Dev/trunk/src/server/bin/heroku.js	(revision 487)
@@ -1,11 +1,14 @@
-var env = require('../env');
-var configCouch = require('../config/config-couchdb');
+var env = require('../env')
+  , configCouch = require('../config/config-couchdb')
+  , designDocs = require('../config/config-couchdb')
+  ;
 
 console.log("Running on",env.couchServerURL);
 
 require('../app').App({
-    couchDbURL: env.couchDbURL
+    couchServerURL: env.couchServerURL,
+    dbName: env.dbName
 }).then(function(app){
-    configCouch(env.couchServerURL);
+    configCouch(env.couchServerURL,env.dbName,designDocs);
     return app;
 }).then(function(app){
Index: Dev/trunk/src/server/bin/upgrade-db-1-to-2.js
===================================================================
--- Dev/trunk/src/server/bin/upgrade-db-1-to-2.js	(revision 487)
+++ Dev/trunk/src/server/bin/upgrade-db-1-to-2.js	(revision 487)
@@ -0,0 +1,19 @@
+var env = require('../env')
+  , upgradeCouch = require('../config/upgrade-couchdb')
+  , cryptoken = require('../util/crypto-token')
+  , Q = require('q')
+  ;
+upgradeCouch(env.couchServerURL,env.dbName,function(doc){
+    if ( (doc.type === 'Response' || doc.type === 'SurveyRun') && !doc.secret ) {
+        return cryptoken(8).then(function(token){
+            doc.secret = token;
+            return doc;
+        });
+    } else {
+        return Q.reject();
+    }
+}).then(function(res){
+    console.log("done",res);
+}, function(err){
+    console.error("fail",err);
+});
Index: Dev/trunk/src/server/config/check-couchdb.js
===================================================================
--- Dev/trunk/src/server/config/check-couchdb.js	(revision 486)
+++ Dev/trunk/src/server/config/check-couchdb.js	(revision 487)
@@ -7,6 +7,6 @@
 var schema = require('./couchdb-schema');
 
-module.exports = function(couchDbURL) {
-    var server = new CouchDB(couchDbURL);
+module.exports = function(couchServerURL,dbName) {
+    var server = new CouchDB(couchServerURL,dbName);
     var designRe = /^_design\//;
     return server.get('/_all_docs')
Index: Dev/trunk/src/server/config/config-couchdb.js
===================================================================
--- Dev/trunk/src/server/config/config-couchdb.js	(revision 486)
+++ Dev/trunk/src/server/config/config-couchdb.js	(revision 487)
@@ -5,8 +5,8 @@
   ;
 
-var designDocs = require('./couchdb-design-docs');
+module.exports = function(couchServerURL, dbName, designDocs) {
+    var server = new CouchDB(couchServerURL);
 
-module.exports = function(couchServerURL) {
-    var server = new CouchDB(couchServerURL);
+    if ( !designDocs ) { throw new Error("Forgot to pass design docs to checkCouch."); }
 
     console.log("Configuring CouchDB for QED");
@@ -14,8 +14,8 @@
     return server.get('')
     .then(function(info){
-        if (info.version !== "1.2.0" ) {
+        if (info.version !== "1.4.0" ) {
             console.log("Found "+info.version+", only tested with CouchDB 1.2.0");
         } else {
-            console.log("CouchDB 1.2.0 found");
+            console.log("CouchDB 1.4.0 found");
         }
     }).then(function(res){
Index: Dev/trunk/src/server/config/couchdb-design-docs.js
===================================================================
--- Dev/trunk/src/server/config/couchdb-design-docs.js	(revision 486)
+++ Dev/trunk/src/server/config/couchdb-design-docs.js	(revision 487)
@@ -11,5 +11,5 @@
 
     "qed/schemaInfo": {
-        version: "1"
+        version: "2"
     },
 
@@ -31,5 +31,7 @@
         language: "javascript",
         validate_doc_update: function(newDoc, oldDoc, userCtx, secObj) {
-            if ( oldDoc && oldDoc.publicationDate ) { throw({forbidden:'Published documents cannot be modified.'}); }
+            if ( oldDoc && oldDoc.publicationDate ) {
+                throw({forbidden:'Published documents cannot be modified.'});
+            }
         },
         views: {
@@ -59,8 +61,8 @@
                     if ( doc.categories && doc.categories.length > 0 ) {
                         for ( var i = 0; i < doc.categories.length; i++ ) { 
-                            emit([doc.categories[i],doc.topic||null],1);
+                            emit([doc.categories[i],doc.topic||"(default)"],1);
                         } 
                     } else { 
-                        emit([null,null],1); 
+                        emit(["(default)","(default)"],1); 
                     } 
                 },
@@ -72,8 +74,8 @@
                     if ( doc.categories && doc.categories.length > 0 ) {
                         for ( var i = 0; i < doc.categories.length; i++ ) {
-                            emit([doc.categories[i],doc.topic||null],1);
+                            emit([doc.categories[i],doc.topic||"(default)"],1);
                         }
                     } else {
-                        emit([null,null],1);
+                        emit(["(default)","(default)"],1);
                     }
                 },
@@ -83,14 +85,20 @@
                 map: function(doc){
                     if( doc.type !== 'Question' ){ return; }
-                    emit(doc.topic);
+                    emit(doc.topic||"(default)",1);
                 },
-                reduce: function(key, values, rereduce) { return null; }
+                reduce: function(key, values, rereduce) { return sum(values); }
             },
             published_topics: {
                 map: function(doc){
                     if ( doc.type !== 'Question' || !doc.publicationDate ) { return; }
-                    emit(doc.topic);
+                    emit(doc.topic||"(default)",1);
                 },
-                reduce: function(key, values, rereduce) { return null; }
+                reduce: function(key, values, rereduce) { return sum(values); }
+            },
+            by_code: {
+                map: function(doc){
+                    if ( doc.type !== 'Question' ) { return; }
+                    emit(doc.code,doc);
+                }
             }
         }
Index: Dev/trunk/src/server/config/couchdb-schema.json
===================================================================
--- Dev/trunk/src/server/config/couchdb-schema.json	(revision 486)
+++ Dev/trunk/src/server/config/couchdb-schema.json	(revision 487)
@@ -1,129 +1,144 @@
 {
+  "$schema": "http://json-schema.org/draft-04/schema#",
   "title": "QED Object Schema",
-  "version": "1",
+  "version": "2",
   "type": "object",
   "oneOf": [
-    { "$ref": "#/schemaInfo" },
-    { "$ref": "#/docTypes/any" }
+    { "$ref": "#/definitions/schemaInfo" },
+    { "$ref": "#/definitions/docs/any" }
   ],
-  "schemaInfo": {
-    "type": "object",
-    "properties": {
-        "_id": { "type": "string", "pattern": "schemaInfo" },
-        "_rev": { "type": "string", "optional": true },
-        "version": { "type": "string" }
-    },
-    "additionalProperties": false
-  },
-  "docTypes": {
-    "any": {
+  "definitions": {
+    "schemaInfo": {
       "type": "object",
-      "oneOf": [
-        { "$ref": "#/docTypes/Question" },
-        { "$ref": "#/docTypes/Survey" },
-        { "$ref": "#/docTypes/SurveyRun" },
-        { "$ref": "#/docTypes/Response" }
-      ]
-    },
-    "Question": {
       "properties": {
-        "type": { "type": "string", "pattern": "Question" },
-        "_id": { "type": "string", "optional": true },
-        "_rev": { "type": "string", "optional": true },
-        "categories": { "type": "array", "items": { "type": "string" } },
-        "code": { "type": "string" },
-        "content": { "type": "array", "items": { "$ref": "#/contentTypes/any" } },
-        "description": { "type": "string", "optional": true },
-        "publicationDate": { "type": "string", "pattern": "", "optional": true },
-        "title": { "type": "string" },
-        "topic": { "type": "string", "optional": true }
+          "_id": { "type": "string", "pattern": "schemaInfo" },
+          "_rev": { "type": "string" },
+          "version": { "type": "string" }
       },
+      "required": ["_id","version"],
       "additionalProperties": false
     },
-    "Survey": {
-      "type": "object",
-      "properties": {
-        "type": { "type": "string", "pattern": "Survey" },
-        "_id": { "type": "string", "optional": true },
-        "_rev": { "type": "string", "optional": true },
-        "publicationDate": { "type": "string", "pattern": "", "optional": true },
-        "questions": { "type": "array", "items": { "$ref": "#/docTypes/Question" } },
-        "title": { "type": "string" }
+    "docs": {
+      "any": {
+        "type": "object",
+        "oneOf":[
+          { "$ref": "#/definitions/docs/Question" },
+          { "$ref": "#/definitions/docs/Survey" },
+          { "$ref": "#/definitions/docs/SurveyRun" },
+          { "$ref": "#/definitions/docs/Response" }
+        ]
       },
-      "additionalProperties": false
-    },
-    "SurveyRun": {
-      "type": "object",
-      "properties": {
-        "type": { "type": "string", "pattern": "SurveyRun" },
-        "_id": { "type": "string", "optional": true },
-        "_rev": { "type": "string", "optional": true },
-        "description": { "type": "string" },
-        "endDate": { "type": "string", "pattern": "" },
-        "mode": { "type": "string", "enum": [ "open", "closed" ] },
-        "startDate": { "type": "string", "pattern": "" },
-        "survey": { "$ref": "#/docTypes/Survey" },
-        "title": { "type": "string" }
-      },
-      "additionalProperties": false
-    },
-    "Response": {
-      "type": "object",
-      "properties": {
-        "type": { "type": "string", "pattern": "Response" },
-        "_id": { "type": "string", "optional": true },
-        "_rev": { "type": "string", "optional": true },
-        "answers": { "type": "object" },
-        "publicationDate": { "type": "string", "pattern": "", "optional": true },
-        "surveyRunId": { "type": "string" }
-      },
-      "additionalProperties": false
-    }
-  },
-  "contentTypes": {
-    "any": {
-      "type": "object",
-      "oneOf": [
-        { "$ref": "#/contentTypes/Text" },
-        { "$ref": "#/contentTypes/StringInput" },
-        { "$ref": "#/contentTypes/ScaleInput" }
-      ]
-    },
-    "Text": {
+      "Question": {
         "type": "object",
         "properties": {
-            "type": { "type": "string", "pattern": "Text" },
-            "text": { "type": "string" }
+          "type": { "type": "string", "pattern": "Question" },
+          "_id": { "type": "string" },
+          "_rev": { "type": "string" },
+          "categories": { "type": "array", "items": { "type": "string" } },
+          "code": { "type": "string" },
+          "content": { "type": "array", "items": { "$ref": "#/definitions/content/any" } },
+          "description": { "type": "string" },
+          "publicationDate": { "type": "string", "format": "datetime" },
+          "title": { "type": "string" },
+          "topic": { "type": "string" }
         },
+        "required": ["type","categories","code","content","title"],
         "additionalProperties": false
-    },
-    "StringInput": {
+      },
+      "Survey": {
         "type": "object",
         "properties": {
-            "type": { "type": "string", "pattern": "StringInput" },
-            "text": { "type": "string" }
+          "type": { "type": "string", "pattern": "Survey" },
+          "_id": { "type": "string" },
+          "_rev": { "type": "string" },
+          "publicationDate": { "type": "string", "format": "datetime" },
+          "questions": { "type": "array", "items": { "$ref": "#/definitions/docs/Question" } },
+          "title": { "type": "string" }
         },
+        "required": ["type","questions","title"],
         "additionalProperties": false
-    },
-    "ScaleInput": {
+      },
+      "SurveyRun": {
         "type": "object",
         "properties": {
-            "type": { "type": "string", "pattern": "ScaleInput" },
-            "minLabel": { "type": "string", "optional": true },
-            "min": { "type": "integer" },
-            "max": { "type": "integer" },
-            "maxLabel": { "type": "string", "optional": true },
-            "naLabel": { "type": "string", "optional": true },
-            "items": { "type": "array", "items": {
-                "type": "object",
-                "properties": {
-                    "text": { "type": "string" },
-                    "minLabel": { "type": "string", "optional": true },
-                    "maxLabel": { "type": "string", "optional": true }
-                },
-                "additionalProperties": false
-            } }
+          "type": { "type": "string", "pattern": "SurveyRun" },
+          "_id": { "type": "string" },
+          "_rev": { "type": "string" },
+          "description": { "type": "string" },
+          "endDate": { "type": "string", "format": "datetime" },
+          "mode": { "type": "string", "enum": [ "open", "closed" ] },
+          "secret": { "type": "string", "minLength": 8 },
+          "startDate": { "type": "string", "format": "datetime" },
+          "survey": { "$ref": "#/definitions/docs/Survey" },
+          "title": { "type": "string" }
         },
+        "required": ["type","description","mode","secret","survey","title"],
         "additionalProperties": false
+      },
+      "Response": {
+        "type": "object",
+        "properties": {
+          "type": { "type": "string", "pattern": "Response" },
+          "_id": { "type": "string" },
+          "_rev": { "type": "string" },
+          "answers": { "type": "object" },
+          "publicationDate": { "type": "string", "format": "datetime" },
+          "secret": { "type": "string", "minLength": 8 },
+          "surveyRunId": { "type": "string" }
+        },
+        "required": ["type","answers","secret","surveyRunId"],
+        "additionalProperties": false
+      }
+    },
+    "content":{
+      "any": {
+        "type": "object",
+        "oneOf": [
+          { "$ref": "#/definitions/content/Text" },
+          { "$ref": "#/definitions/content/StringInput" },
+          { "$ref": "#/definitions/content/ScaleInput" }
+        ]
+      },
+      "Text": {
+        "type": "object",
+        "properties": {
+          "type": { "type": "string", "pattern": "Text" },
+          "text": { "type": "string" }
+        },
+        "required": ["type","text"],
+        "additionalProperties": false
+      },
+      "StringInput": {
+        "type": "object",
+        "properties": {
+          "type": { "type": "string", "pattern": "StringInput" },
+          "text": { "type": "string" }
+        },
+        "required":["type","text"],
+        "additionalProperties": false
+      },
+      "ScaleInput": {
+        "type": "object",
+        "properties": {
+          "type": { "type": "string", "pattern": "ScaleInput" },
+          "minLabel": { "type": "string" },
+          "min": { "type": "integer" },
+          "max": { "type": "integer" },
+          "maxLabel": { "type": "string" },
+          "naLabel": { "type": "string" },
+          "items": { "type": "array", "items": {
+            "type": "object",
+            "properties": {
+              "text": { "type": "string" },
+              "minLabel": { "type": "string" },
+              "maxLabel": { "type": "string" }
+            },
+            "required":["text"],
+            "additionalProperties": false
+          } }
+        },
+        "required":["type","min","max","items"],
+        "additionalProperties": false
+      }
     }
   }
Index: Dev/trunk/src/server/config/couchdb-upgrade-design-docs.js
===================================================================
--- Dev/trunk/src/server/config/couchdb-upgrade-design-docs.js	(revision 487)
+++ Dev/trunk/src/server/config/couchdb-upgrade-design-docs.js	(revision 487)
@@ -0,0 +1,11 @@
+module.exports = {
+
+    "qed/schemaInfo": {
+        version: "-1"
+    },
+
+    "qed/_design/default": {
+        __configAction: "replace"
+    }
+
+};
Index: Dev/trunk/src/server/config/upgrade-couchdb.js
===================================================================
--- Dev/trunk/src/server/config/upgrade-couchdb.js	(revision 487)
+++ Dev/trunk/src/server/config/upgrade-couchdb.js	(revision 487)
@@ -0,0 +1,38 @@
+var Q = require('q')
+  , _ = require('underscore')
+  , tv4 = require('tv4')
+  , CouchDB = require('../util/couch').CouchDB
+  ;
+
+var schema = require('./couchdb-schema');
+
+module.exports = function(couchServerURL,dbName,upgrade) {
+    var server = new CouchDB(couchServerURL,dbName);
+    var designRe = /^_design\//;
+    return server.get('/_all_docs')
+    .then(function(allDocs){
+        return _.chain(allDocs.rows)
+        .filter(function(doc){
+            return doc.id.match(designRe) === null;
+        })
+        .reduce(function(memo, doc){
+            return memo.then(function(result){
+                return server.get(doc.id)
+                .then(function(doc){
+                    Q.when(upgrade(doc))
+                    .then(function(newDoc){
+                        return server.put(doc._id,newDoc)
+                        .then(function(){
+                            result[doc._id] = true;
+                            return result;
+                        });
+                    },function(){
+                        result[doc._id] = false;
+                    });
+                    return result;
+                });
+            });
+        }, Q.resolve({}))
+        .value();
+    }).all();
+};
Index: Dev/trunk/src/server/env.js
===================================================================
--- Dev/trunk/src/server/env.js	(revision 486)
+++ Dev/trunk/src/server/env.js	(revision 487)
@@ -3,4 +3,4 @@
     port: process.env.PORT || 5000,
     couchServerURL: couchServerURL,
-    couchDbURL: couchServerURL+'qed',
+    dbName: 'qed'
 };
Index: Dev/trunk/src/server/util/couch.coffee
===================================================================
--- Dev/trunk/src/server/util/couch.coffee	(revision 486)
+++ Dev/trunk/src/server/util/couch.coffee	(revision 487)
@@ -6,32 +6,42 @@
  
 class CouchDB
-    constructor: (url) ->
-        @url = normalizeURL url
-    get: (id) ->
+    constructor: (url,db) ->
+        @serverURL = normalizeURL url
+        @db = db
+        if @db
+            @url = "#{@serverURL}/#{@db}"
+        else
+            @url = "#{@serverURL}"
+    get: (id, opts) ->
         url = "#{@url}/#{id}"
-        couchRequest 'GET', url
-    post: (doc) ->
-        url = "#{@url}"
-        couchRequest 'POST', url, doc
-    put: (id, doc) ->
+        couchRequest 'GET', url, null, opts
+    post: (doc, opts) ->
+        url = "#{@url}/"
+        couchRequest 'POST', url, doc, opts
+    put: (id, doc, opts) ->
         url = "#{@url}/#{id}"
-        couchRequest 'PUT', url, doc
-    delete: (id, rev) ->
-        url = "#{@url}/#{id}?rev=#{rev}"
-        couchRequest 'DELETE', url
+        couchRequest 'PUT', url, doc, opts
+    delete: (id, opts) ->
+        url = "#{@url}/#{id}"
+        couchRequest 'DELETE', url, null, opts
+    uuids: (opts) ->
+        url = "#{@serverURL}/_uuids"
+        couchRequest 'GET', url, null, opts
 
 normalizeURL = (url) ->
     url.replace /\/$/, ''
 
-couchRequest = (method, url, data) ->
+couchRequest = (method, url, body, opts) ->
     options =
         method: method,
         headers:
-            'content-type': 'application/json; charset=utf-8'
-            'accept': 'application/json'
-        body: JSON.stringify (stringifyFunctions (data || {}))
+            'Content-Type': 'application/json; charset=utf-8'
+            'Accept': 'application/json'
+        body: JSON.stringify (stringifyFunctions (body || {}))
+    if opts
+        options.qs = createQueryObj opts.query if opts.query
+        _.extend options.headers, opts.headers if opts.headers
     req = request(url, options)
-    req.response
-    .then (res) =>
+    res = req.response.then (res) =>
         req.then (res) =>
             JSON.parse res
@@ -40,5 +50,18 @@
     , (err) =>
         Q.reject err
+    res.response = req.response.then (res) =>
+        statusCode: res.statusCode
+        headers: res.headers
+        body: JSON.parse res.body
+    , (err) =>
+        Q.reject err
+    res
 
+createQueryObj = (obj) ->
+    newObj = {}
+    _.each obj, (val,key) ->
+        newObj[key] = JSON.stringify val
+    newObj
+        
 stringifyFunctions = (value) ->
     if value is null
Index: Dev/trunk/src/server/util/crypto-token.js
===================================================================
--- Dev/trunk/src/server/util/crypto-token.js	(revision 487)
+++ Dev/trunk/src/server/util/crypto-token.js	(revision 487)
@@ -0,0 +1,14 @@
+var Q = require('q')
+  , crypto = require('crypto');
+
+module.exports = function(bytes) {
+    var q = Q.defer();
+    crypto.randomBytes(bytes || 8, function(ex, buf) {
+        if ( ex ) {
+            q.reject(ex);
+        } else {
+            q.resolve(buf.toString('hex'));
+        }
+    });
+    return q.promise;
+};
Index: Dev/trunk/src/server/util/etags.js
===================================================================
--- Dev/trunk/src/server/util/etags.js	(revision 487)
+++ Dev/trunk/src/server/util/etags.js	(revision 487)
@@ -0,0 +1,14 @@
+var _ = require('underscore');
+
+var revRe = /"([^"]*)"/g;
+
+exports.parse = function(header) {
+    return _.map((header && header.match(revRe)) || [], function(str){
+        return str.substring(1,str.length-1);
+    });
+};
+
+exports.format = function(etags) {
+    return _.map(etags || [], function(str) { return '"'+str+'"'; })
+            .join(', ');
+};
Index: Dev/trunk/src/server/util/http-result.js
===================================================================
--- Dev/trunk/src/server/util/http-result.js	(revision 487)
+++ Dev/trunk/src/server/util/http-result.js	(revision 487)
@@ -0,0 +1,78 @@
+// <init> :: status? -> result? -> HTTPResult
+function HTTPResult(status,result) {
+    this.status = 0;
+    this.result = null;
+    this._handlers = [];
+    if ( status ) {
+        this.set(status,result);
+    }
+}
+
+HTTPResult.fromResponsePromise = function(promise,errorHandler) {
+    var result = new HTTPResult();
+    promise.then(function(response){
+        result.set(response.statusCode,response.body);
+    }, errorHandler && function(error){
+        var ret = errorHandler(error);
+        if ( ret.constructor === HTTPResult ) {
+            ret.handle(result.set.bind(result));
+        } else {
+            result.set(500,ret);
+        }
+    });
+    return result;
+};
+
+// isSet :: Bool
+HTTPResult.prototype.isSet = function() {
+    return this.status !== 0;
+};
+
+// set :: status -> result? -> ()
+HTTPResult.prototype.set = function(status,result) {
+    if ( this.isSet() ) { throw new Error("Result was already set."); }
+    if ( typeof status !== 'number' ) { throw new Error("Status must be a number."); }
+    this.status = status;
+    this.result = result;
+    for ( var i = 0; i < this._handlers.length; i++ ) {
+        this._fire(this._handlers[i]);
+    }
+};
+
+// _fire :: (status -> result -> Either HTTPResult Any) -> ()
+HTTPResult.prototype._fire = function(f) {
+    var ret = f(this.status,this.result);
+    if ( ret.constructor === HTTPResult ) {
+        ret.handle(f._next.set.bind(f._next));
+    } else {
+        f._next.set(this.status,ret);
+    }
+};
+
+/* handle :: Either (status -> result -> Either HTTPResult Any)
+ *                  {number: (result -> Either HTTPResult Any),
+ *                   'default': (status -> result -> Either HTTPResult Any)}
+ *           -> HTTPResult
+ */
+HTTPResult.prototype.handle = function(fOrObj) {
+    var f = typeof fOrObj === 'function' ?
+            fOrObj :
+            function(status,result) {
+                if ( status in fOrObj ) {
+                    return fOrObj[status](result);
+                } else if ( 'default' in fOrObj ) {
+                    return fOrObj['default'](status,result);
+                } else {
+                    return result;
+                }
+            };
+    f._next = new HTTPResult();
+    if ( this.isSet() ) {
+        this._fire(f);
+    } else {
+        this._handlers.push(f);
+    }
+    return f._next;
+};
+
+module.exports = HTTPResult;
