Merge pull request #350 from stianst/constraints

Enforce that realm name is unique in model
Ensure application and client names are unique within realm