Unfortunately, engine builders vary greatly from place to place, but for a straight, normal engine expect around $2000. If you do it yourself, a kit with all the needed seals should be around $1300.
New housings will give best performance and longer life, but adds considerable cost since they're over $500 each. If a housing passes inspection it will work. Maybe not for 100,000 miles, but plenty of life.
Check
www.mazdatrix.com and
www.racingbeat.com for pricing on OEM rebuild kits.
If this isn't going to be a your only car and you have a garage, I recommend doing the rebuild yourself should the time come. There are books and at least 4 DVDs showing the procedure. I did mine myself in a borrowed garage.