Remove unused variables

Address the 'variable set but not used' warning from GCC.  In some cases a few
additional calls were removed where there should be no visible side effects of
the calls (i.e. should not effect any cached state).
Core: address comparison of signed and unsigned types

Add a cast to ensure that the comparison is done with the same sign type.
Identified by GCC.
Interpreter: explicitly initialize base class

Initialise base class std::enable_shared_from_this explicitly.  Identified by
GCC.
Interpreter: kill some dead code

Remove commented out code and an unnecessary associated scope.  No functional
change.