Add support for libgit2 filters

This is a work in progress, still need:

1. Better test cases
2. Documentation
3. Verify no memory leaks
4. Iron out API.