New unit tests, more complete profile management