Address comments by JakeWharton

- Add documentation to changed methods
- Add handling for primitive arrays
- Add unit tests for primitive array handling