Adds 'required' option to hasOne associations

Not sure if tests are done the right way.