modified getMessages() to return an object instead of an array

the object contains the messages per validation name. this makes
it possible to render messages where they belong to (ie. the input
fields whose value didn't validate).