  The purpose of this paper is to make the theory of vertex algebras trivial.
We do this by setting up some categorical machinery so that vertex algebras are
just ``singular commutative rings'' in a certain category. This makes it easy
to construct many examples of vertex algebras, in particular by using an
analogue of the construction of a twisted group ring from a bicharacter of a
group. We also define quantum vertex algebras as singular braided rings in the
same category and construct some examples of them. The constructions work just
as well for higher dimensional analogues of vertex algebras.
