formatted code, you can now drag tabs, and various minimal bug fixes. Also moved parser to a separate class so it's cleaner