Changed validate method to throw exception on invalid dict, with optional safe parameter to just return true/false