Fix compiling for jk2 on linux.

I have cleaned up the JK2 code to compile cleanly on linux. It currently compiles, and the .so file loads at runtime. Nothing else works thus far.