Expand test coverage, refactoring, and add pmean

- Fix object extension binding
- Extend from Collection where possible
- Test sample and math functions
- Add pmean