Added tests for JSON extraction

Incapsulated extraction into Remote.extractObject
and added scalatest specs for it