Add namespace prefix constants to clean up code

Define refs, ref, xsd, owl, mml, and mrs namespace prefix constants to
make code easier to read.
More code cleanup, rename image to icon

Define ICON_PATH constant for maintainability in case resources/ folder
is later subdivided into resources/icons/.

References to 'image' replaced with 'icon' to be more specific.

Code block for determining icon path converted from nested switches
into self-executing anonymous function, which reduces code length by
2/3rds.