Add support for getting the resourceId attribute of an element

It makes a lot of sense in our tests to get access to the resource id of an element. This pull requests add support for getting it through the getAtrribute api.
Instead of `if (API_18) {` indenting a bunch of code, how about:

```java
String resourceId = "";
// Resource ID requires API 18
if (!API_18) {
    return resourceId;
}
```