cache refactoring: Use bit field for PyGIDirection instead of enum

This supports cleaner logic when testing the direction of
arguments due to the majority of these tests being along the
lines of: (direction == FROM_PYTHON || direction == BIDIRECTIONAL)
Which is replaced with: (direction & FROM_PYTHON)

https://bugzilla.gnome.org/show_bug.cgi?id=640812