Cleaned up native code, and freshed up documentation.