Fixes issue with hash length and loading external chunks

If the length option on a hash was being used for a file path template
(e.g. '[hash:8].js'), the file would be outputted with the correct name,
but the reference inside require.ensure would not work, because the length
truncation would operate on more than just the hash, and would truncate
some of the characters added to pad the hash value.

Fix is to implement the `hashWithLength` function where this is a problem.
This doesn't feel like a proper solution, as it adds some redundancies
in a few places, but it's only in the chunk loading blocks that this matters,
so it's small in scope.
Updates hash length tests to catch async chunk loading
fixes #524 again
reorganized function
Merge branch 'feature/fix-555' of https://github.com/diurnalist/webpack into diurnalist-feature/fix-555
include [chunkhash] tests again
added support for [chunkhash] with target node
ignore hidden files
fixes #474
1.4.11