High energy factorization and small-x heavy flavour production