Add signals and other fixes

I added signals for TreeView and TreeSelection. I also added some miscellaneous fixes for problems I found as I went along, such as making some parameters mutable or optional.