“important too is the general proposition that formal agreements properly and fairly arrived at with competent legal advice should not be displaced unless there are good and substantial grounds for concluding that an injustice will be done by holding the parties to the terms of their agreement”