tests for hasOwnProperty and hasProperty; small refactorings