[Add] A few more xml macros and cleaned up a little code to use them.
[Add] Layers should be working properly.