Refined BPS invariants, Chern-Simons theory, and the quantum dilogarithm