Added optional context parameter to matrix and scalar types.

backend::memory_create now requires a context parameter in order to help a quick transition.