new plugin: layer-count

fixes #821
use predefined constants
updated comments
Merge pull request #866 from fkloft/layercount

new plugin: layer count