require config instead of reading as json file

not tested yet.

will close #221.