A ton of changes

- implement the two phase method for finding an initial basis
- squash bugs everywhere
- other things