Add bewit unit test. Finish server credentials refactor