Dev sam

So many conflicts. The main contribution for this pull request was getting user auth working.