Switch HMEF attributes to a factory scheme for creation, then add subtypes for cleaner code. Also adds a few more tests