Moved to Gradle. Removed manual array copies.

Also moved to SDK 21 with sdk checks for lower SDKs so Lint doesn't
break.