Handle different types of manifest

Changed 'tubes' for 'details', because it's really sample level.
Added 'model' which comes from the template.
Changed variable name 'tube' for 'resource'.
Changed variable name 'tubeDetails' for 'details'.
Use specialised extractor to get a receptacle of samples.
Group details based on barcode.
Treat group as group of promises that need updating.
Parallise manifest generation

Samples & barcodes can be created in parallel.
Pair up samples with barcodes.
Put samples in tubes & label tubes with associated barcode.
Generate a manifest based on sample+barcode pairs.
The last two can be run in parallel.
Fix saveAs issue as filesaver.js doesn't work with require.js
Big refactor to get towards supporting plate manifests.

Extracted tube specified manifest code into a "generator".
Bound the generator to the template at template load time.
Call the template generator to make the manifest.
Plate generator is currently a random comment!
Fully support plate manifest generation.

Extracted resource creation from tube generator.
Added plate generator.
Fixed up the custom Ajax for manifest template handling.
Moved manifest merger URL out into configuration.
Made template registration a bit cleaner.
Fixed up some of the template configuration behaviour

Collapsed JSON templating code into template code
Aliquot type is bound to the sample type, not template directly
Merge pull request #313 from mattdenner/handle_plate_manifests

Handle plate manifests