Added gradle build, reorganized the lib