Added foundation and completed sign-in/out functions