  Finite-order invariants of knots in arbitrary 3-manifolds (including
non-orientable ones) are constructed and studied by methods of the topology of
discriminant sets. Obstructions to the integrability of admissible weight
systems to well-defined knot invariants are identified as 1-dimensional
cohomology classes of generalized loop spaces of the manifold. Unlike the case
of the 3-sphere, these obstructions can be non-trivial and provide invariants
of the manifold itself.
  The corresponding algebraic machinery allows us to obtain on the level of the
``abstract nonsense'' some of results and problems of the theory, and to
extract from other the essential topological part.
