Deal with JVM arrays as objects

Pull-request for #15

Comments are welcome!