Moved Weave initialization code out into a separate file.