Reorganized method lookup completely, switching to templated C++.
Self-review