Acyclicity Notions for Existential Rules and Their Application to Query Answering in Ontologies