Get library test cases in place, a few bug fixes

* Get phpunit test suite up and running, covering about 84% of the library.
* A few bugs resolved (broken methods, bug in half-move FEN generation)
* Minor project structure changes