Implemented analyzer in service and updated relevant code in Spark.

Implemented analyzer in service and updated relevant code in Spark (squashed commits)

@devoncarew