changed resource creation to take "this" ptr instead of context ptr.

Allows us more flexibility in the future for resource tracking without needing to change API (e.g. we can now record who created a resource if we wanted to).  This has a companion PR in cycamore.