Feedback from code review:
- Scala xy loops
- add "final" qualifier to constants
- add try/finally clause around spark operations to cleanly stop the spark context