Dispatch on C/Python Expressions based on type

It's not safe to check for a .code attribute in an Expression and assume
it's a "C kernel" one, since the user may have subclassed expression and
called the superclass __init__ method.  Instead, check the type.