code cleanup

- remove useless comments
- typeFilter() uses 'when' instead of multiple if's
- remove unreachable code from typeStr()
- typeStr() generates optionally nullable types
- remove StringBuffer preallocation
- replace map with forEach when result is discarded
- add kotlin-style map access
- fix typos