Various Improvements

Cleaned up the scopes and added a couple missing elements. One item that is still wrong is #function which shouldn't be punctuation, but I wasn't able to find an example of it's usage in the spec to scope it correctly.