Huge refactor

I majorly refactored the code. The doc generation seems to be working, however, I disabled the tab behavior for the time being because it was buggy and ruining normal tab behavior outside of the doc blocks. The code is still there, I just return out of the handler function. I'll look into fixing that tomorrow. In the mean time, kindly look over the changes (it's basically rewritten but follows your logic).