v1.6.5 - Internal release

Reorganized & cleaned up code, fixed tabbing.