Fix of xblock for opaque keys

 Fix of sga.py for opaque keys and
test.py for the resulting test failures.