Migration to Gradle

Still has some build problem
Resolved some build issue