Use getters for namespace attribute access for MW 1.20 compatility.

The attributes are now protected so can't be indexed directly anymore.
This should still be bw compatible with 1.16.