Split PHP functions into common file
Add auth.SimpleAuth, which will be useful for local testing