Add Phar generation to CI
Add some unit tests