Move to copy on write array set

Not sure if there was some reason this wasn't done before - went from 8-10% of the time in advance waiting on iterator, to 0.8%.

Gradle build file update also helps speed things up, at the cost of requiring clients to have sdk version 19 (should have it now, and required 17 before).