Expand FFI support for repository and references

Added initial set of tests

Signed-off-by: Stefan Marr <git@stefan-marr.de>