Fixed unittests
Layer code split
Moved tests out of the package itself