See desc.

Ported all but one functions. Added in few classes, global vars, etc.
This is just an ugly update/progress report for you guys.
Still needs testing, optimization, and major cleaning up.