fix relation each_batch, retry on 509 error

* fix get_options and parameter
* move parameter spec to relation_spec.rb
add limit to relation. Add loggin facility to session
remove pry on session
fix bug on sensor with parameter
fix bug date not converted to a Numeric value
find_sensor_by_name receive parameter type string or regex
create function to find_or_new or find_or_create on sensor
pull find_or_new & find_or_create to EndPoint module