Refactoring, Debug, Tests

- [x] Fix severals bugs
- [x] Add functional test
- [x] Update phpdocs
- [x] PSR-2 Compliant
- [ ] Rewrite the docs
- [ ] Add unit tests
- [ ] Fix #6