Introduce competitions

Added competition layer. All the functions are filtered by the
competition. The current competition is stored in the current session.