Re-factor d3.layer unit tests to be more focused
Fix typo
Add unit test for lifecycle event invocation order

Rsolves issue #15 on GitHub