Lots of minor cleanup

- Remove dead code
- `var`-blocking
- Fix type and variable names for consistency
- TODO(hb): TestLSOFParsing missing?