Use Map.entrySet where possible

Improves run-time efficiency and addresses FindBugs warnings.
Merge pull request #1220 from maginatics/entry-set

Use Map.entrySet where possible