consider the constants and the variables. what all did you change?
i am assuming you simply dropped the engine in, kept all else the same like wiring, carbs, exhaust, etc.
your constants would be the same, wiring, carbs, fuel system, etc.
if you had a running issue prior, look at what wasnt changed. typically a backfire is a lean condition. under load and high rpm sounds like its starving for fuel. check your carbs.
from there, plugged or kinked fuel vent lines, a pinhole in any of the fuel supply lines or even the impulse line can trigger these symptoms, down to the fuel pump itself.
electrical can come into play as well. the ground was already mentioned, but you could have an issue with a wire in the mag or anywhere else arcing under load. bad spark plugs, bad connection at the plugs, even bad plug caps.