change service() to accept instance, not constructor

add tests for resolving remote refs

add test for parsing arrays (currently failing)
fix parsing of arrays
add tests for resolving remote id- and path- references