Code cleanup: Remove several deprecated methods, add const, etc.