First batch of unit tests for layers.
Merge pull request #47 from dnouri/test-layers

Add first bunch of tests for layer module