Refactor common code to load Jni methods

Change-Id: Ia6b56f2926b4ad37b313bd33105f7d4fe757ccac
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1543
Reviewed-by: Matthew Jacobs <mj@cloudera.com>
Tested-by: Matthew Jacobs <mj@cloudera.com>