Add docstrings
Simplify getattr logic
Add tests for base.py