Upgrading to Gradle 1.12

This pull request upgrades Gradle to 1.12, including the Gradle wrapper.

Since 1.12, local functions seems not available in included scripts. So changed them to be in the project extensions.