Fix getAttribute&getMethod to work under inheritance, tests too

    hasMethod and hasAttribute both check whether the method/attribute
    exists in the inheritance hierarchy, so we need the local check
    here instead. Otherwise when you inherit "foo" then you get an error
    on methods("foo").