Add Gradle support.

Adding Gradle support to both Library and Demo.
Please review as I'm not sure if this is clean enough. I'm very new to Gradle.