Refactor mahara plugin classes

Change-Id: I0fdc9fc68ae7ffd2fa2dffe68dfbd79ee9599c06