Reorganized the lib to build with gradle