Improve internal documentation

- Add various type hints where possible
- Removed unused "use" statements
- Fix some inaccurate PHPDoc blocks