More flexible `extraScripts`

Now `extraScripts` can either be an array (legacy mode; inserted into test page
after the bootstrap for AT tests) or an object with `before` and `after` nodes,
specifying insertion order with respect to the bootstrap.

This commits reverts the default behavior of legacy mode to add files
*before* the bootstrap (as was changed in 5c6e86606fa306f22652bc1a3f711191defdbe5a)
to the old behavior of 1.2.1 which is to add them *after* the bootstrap
(which was used mainly to include the atskin after the framework).

Internally, in JSON files describing the test page templates, instead
of just `head`, also `head-start` and `head-end` are available now.

Close #55. Close #58.
Allow calling this.$TestSuite.$constructor from AT test suites.

This commit allows to use "$constructor" in addition to "constructor"
from a test suite (to call its parent), as it is allowed in Aria Templates,
with the following commit:
https://github.com/ariatemplates/ariatemplates/commit/cc720b567e207a4250a850f674fd32608b164d00
Fix extraScripts legacy mode issue

If run from command line with just one extraScript, it was passed as a
string instead of a one-element array and hence not included in the page.
Fixing an issue with browser disconnection and task timeouts.

This commit fixes the following bug: when a browser is disconnected
during a test, the task timeout function is not canceled. When it is
executed, it assigns a new task to the disconnected browser, which
will lead to a timeout (as there is no browser connected to execute
the task), and then another task will be assigned and so on...
Better error msg when test case has syntax error

Close #64.
Filter tests to be run by jasmine

Possibility to filter which attester specs should run;
useful for debugging attester.

Usage:
 grunt jasmine_node --grep=<pattern>

Close #60.
1.3.0
Adding some support for require syntax in Aria Templates tests.

A future version of Aria Templates will integrate noder-js and
allow the use of require in any module (when using the new syntax).
This commit makes attester compatible with the use of this
new syntax inside tests.
It is needed because, before this commit, attester extracted
the classpath from a test file by executing that file in a special
environment (containing a fake Aria.classDefinition method to extract
the class definition, but with no require function available). This
is no longer possible with the new syntax, and adding a fake require
function to that special environment would not be easy.
The new algorithm, which is only used when the new syntax is detected,
parses the file with Uglify-JS and extracts the required information
(classpath of the current class and logical path of the parent class),
without executing the file.
In case the file is detected to be a test suite, extending directly
from require("ariatemplates/jsunit/TestSuite"), only the constructor
function is executed, in a special environment, to get the classpaths
of the tests included in the test suite.
Instrument all files from the beginning (fixes coverage results).
Allows browsers to cache resources to improve performance.
IE11 support

Close #78
Bump jasmine, jshint and other deps

Close #83
Fix ua-parser require issue

In 44ed552b542dc65e7cfe9360ebd631fc7eeb0a75 the dependency has been
changed in package.json but it was not updated in the code.
Removing exit-process.js and using the exit npm module instead.
Improve error handling for PhantomJS

1) Try to reboot Phantom instance (3 times) if it died from recoverable error
2) Exit attester when all PhantomJS instances died without hope to recover

This fixes the following issues:

- In case it was impossible to connect to attester by PhantomJS
  instance within specified timeout, the phantom process was exiting,
  but without propagating the error to attester.
  Now it propagates the error, and additionally the timeout was increased

- Now once the page emits `DOMContentLoaded`, the timeout starts from zero

- If all PhantomJS processes die (i.e. exit with code != 0) for any reason,
  now this is caught and makes attester exit with non-zero code too.

- Also, Phantom instances now have deterministic ids from 1 to N.

Close #79
1.4.0
Fix onInitialized overwriting

In commit a26269f083eb51c49626d587a645f55f771c826c
page.onInitialized was mistakenly overwritten which made robot unusable.

Close #85.
1.4.1
Fixing travis build (by updating npm in before_install).
Plugin for test pages

After the refactoring this is the first pull request that allows using plugins, so far only to modify the content of a test page.

This is achieved by exposing some middlewares and adding the modules

- plugins where you can require a plugin from disk or npm
- testPage where you can add element into a test page

For testing purposes, this pull request introduces also an attester.dispose to cleanly dispose all objects created.

Conflicts:
	lib/attester/cli.js
	lib/test-type/aria-templates/at-test-type.js
	lib/test-type/base-test-type.js
	lib/test-type/mocha/mocha-test-type.js

Conflicts:
	lib/launchers/phantom.js