Weights on cohomology, invariants of singularities, and dual complexes