Added function to check if backend implements an interface

A possible solution for #664.

If this PR is accepted I'll start retrofitting all the primitives to perform this check.