Theory of the singly quasidegenerate Josephson junction parametric amplifier