Satisfy type class dictionaries when LHS of a function application is constrained

@garyb @joneshf Mind having a look at this? It's not exactly a simple fix, but I think these changes all make sense.

Resolves #508.