Initialize cb.main using promises, fixes #186