[MAT-387][WIP] Make terminal constructors private and provide factories

[MAT-387] Terminal factories - compiles but tests fail

[MAT-387] Fix RTTI by using constructors of subclasses

[MAT-387] Correct type of logical matrix by using correct constructor

[MAT-387] Reset shared_ptrs in jterminals test

This is so that they can be deleted whilst the JVM and environment
is still around for their unbinding.
[MAT-387] Make Expr constructors private
[MAT-387] Delete dead code
[MAT-387-API] Delete more dead code
[MAT-387] Separate symbol visibilty and stack flags
[MAT-387] Remove stack flags
[MAT-387] Remove terminal methods that took a raw pointer
Revert "[MAT-387] Remove stack flags"

This reverts commit 624f32238db3e14aaa2cad1d6f1261652b44c9d7.
Revert "[MAT-387] Separate symbol visibilty and stack flags"

This reverts commit a18badaeae084918fa02e7aa300504ac1f183c18.
[MAT-387] Document windows flags
[MAT-387] Remove iss functions that take pointers
[MAT-387] Comment on terminal container
[MAT-387] Add some comments, delete some dead code
[MAT-387] Make some things const refs
[MAT-387] More const
[MAT-387] More const refs, simplify runtree cleanup
[MAT-387] Make more things const refs
[MAT-387] Remove comment (will be handled in another ticket
[MAT-387] Reinstate disabled checks
[MAT-387] Fix up after rebase