Modified Villain formulation of abelian Chern-Simons theory