Use maximum z-index among parents to calculate new one
Fixed Function.apply usage for node.js

Browsers accept the array-like object, but node.js seems to want an actual array.
Use Math instead of null as the context for Math.max.apply()

See http://stackoverflow.com/questions/1669190/javascript-min-max-array-values/1669337#1669337
Merge pull request #1 from mjomble/patch-1

Fix Z-Index