Added lib/layer.js