Refactor internal implementation

1) Store the tox pointer inside the java class, this eliminates one mape
2) Eliminate all uses of shared_pointer