Completely debugged and refactored tab completion. Separated into more logical class structure for flexiblity.