Refactored the backend authentication functions so that they can be exposed to the tee filter. This allows the tee filter to use the same functions as the protocol modules use without having to reimplement them inside the tee filter.