Implement APIs for manipulating resources and components

All queries have been moved to the origins.graph.queries module.

All statements have been changed to used parameters to take advantage
of prepared queries in the database.

Signed-off-by: Byron Ruth <b@devel.io>