Added NDK support, primarily for the use of the native function stat().
Now we don't have to have several attempts at figuring out if a file exists.
There's lots of unchecked code in here that needs cleaning up.