WIP code. Checking in for backup purposes.

Mostly copy/paste from the spark shell at the moment. Works in the
shell but not sbt run at this point. Will fix soon.