Reformat syntax to closer match community standards

* Use 2 space indents instead of 4
* Consistently using uppercase letters in character mappings
* Add folding markers for functions