Move to flask login

@Skablam ready for a once over