JNI Refactor

Added to ksDensity function. Beginning to do a major JNI code refactor.