fix Int#to_s and migrate Java FFI Int to longs

A rewrite that closes #592 and closes #458