Removed all traces of framework-specific garbage.
Fixed up many code issues.

- Lots of if/else statements were lacking braces
- Braces were placed inconsistently
- PHPDoc comments were formatted inconsistently
- Many methods were unnecessary private (rather than protected)
- Added array type hints in a few places