Fixed use of deprecated api; Added initial gradle support.