Minor speed improvements:
* use concat() instead of slice() to copy arrays
* Instantiate array using [] instead of new Array()
* Hoist array lengths in for loops where appropriate
* Cleaned up imports
Merge pull request #1 from rolandzwaga/master

Minor speed improvements :)