StatementRef track chain info on storage
don't duplicate code from js to java (index-building); fix missing
SubStatement fields; test confirming StatementRef doesn't work yet as
expected
fixes statementRef for queries with agents and/or activities without
related-flags
fixes query for StatementRef X->Y->Z with arguments from both X or Y and
Z