Adjust SubStatement object handling in Statement/StatementBase

* Add unit test for detecting non-null SubStatement as Statement object