Added new LayerType and Layer classes to replace the current int[]
layout for all layers and add more room for different types of layers.