Statistical mechanics of polyampholytes