Cleanups, make architecture independent, edit postgres authentication