Tidy jni code
Implemented a payoff function parser for the JNI code.