avoid "and"; avoid multiple elsif
Avoid some use of .nil?
Whitespace changes to match existing style
Toward more idiomatic ruby
Tidying up more comments
Test fields=some:relationship
Test various values for levels=
More fields= tests, including globbing and sub.fields