PAM and userstate fixes for Unity, some optimiations for unit tests, Unity folder name changes