moved loading logic into its own file.

exposed some of the loaders functions as methods.