More modularization and cleanup refactoring

Turn typeNames and iconNames arrays into hashes which simplifies some
parts of the code.

Add new properties hash and hasProperty() function to simplify property
checking

Add mergeProperties(), hasType(), shouldBeDisplayed(), and isTopology()
helper methods.