Pass around C pointers as Java long

so we're 64bit-ready