FACTORIZATION PROPERTIES OF GENUS-TWO BOSONIC AND FERMIONIC STRING PARTITION FUNCTIONS