Also some typos and reformatting parts of the code
Former-commit-id: 0f1de44fab44a09c49d08421a3c2032123d3023b
Former-commit-id: 810b6b1bce1f7feeee7c33bec5ff16915367db17
Mainly convert mainloop and audio thread into native code for
performance increase. (Calling into JNI every frame was costy)
The code was cleaned up quite a bit, but I may have introduced new bugs
in this process :<
Former-commit-id: fdbc21b5ab39f3d2e36647fd1177dc9a84a16980
Former-commit-id: ac765dbee8c994e1b69cc694846511837c2685b9