Added case StatementRef for conversion from jObject to StatementBase

If a statement which contains a statement reference as object is converted to a jObject and back, the statement reference is discarded.
The issue is that the exception would have to come from the SubStatement handler. It is what needs to prevent the nesting, but it is effectively this method right now.