Issue 157

Actually, the `streamcontext` table needs to be joined even when no context query is provided. The need depends on the record type. In case there are more record types introduced in the future, the `INNER JOIN` may not always be possible. An array holding the record type names for which the join should be performed is introduced.

Resolves #157