Added unit test

- Unit test
- Some minor improvements
- rank handler now takes url as a get rather than post 

This will also need some changed in readme. I will do it after we have the other readme PR merged.
https://github.com/cdap-guides/cdap-spark-guide/pull/16
you have to make changes in README ?