Clean up

- Fixed various warnings and removed unused code.
- Addressed various inefficencies
- Replaced array keyed maps with guava tables