Ordering of the Exponential of Quadratic Forms in Boson Operators and Some Applications