return program ID when creating a program in a context
added method hasCapabilityCriteria
removed some unused code