Performance improvements.

- Move to Java interface instead of protocol for primitive types.
- Use mutable object to store buffer position rather than atoms.
- Use dotimes in preference to doseq