Improve code following felerian's suggestions

- Use isupper() instead of self-made _isyelling()
- Use endswith() for suffix testing
- Better test for empty/only whitespace text
- Improve docstring format