Multifunctional epoxy resin with enhanced flame resistance