Improved isInFront isBehind methods to be aware of z-index. Added unit tests for z-index related functions.