Improve performance

Take getWhereStatement from O(3n) to O(n) and avoid dropping to the
native layer twice on getTableName() and getNotificationUri()