Refactored how layer class are created/inherited.

Also added development debug capabilities with the DEBUG property
Improve documentation