Auth
I have now refactored the code and got rid of unnecessary code. I also added some tests for the functionality of Auth. Some of the tests needs to be further developed when we have gotten more functionality in place. Unfortunately i forgot to pull from dev when creating this branch. Because of this there is some extract Metadata functionality in the Merge Requests. I will pull clean up extract metadata after getting this MR accepted.