Using plain array in buildGeometry() but still compatible with ArrayList

This is so you don't need to depend on javascript.util in your code and can use a plain JavaScript Array to call `buildGeometry`.