require config instead of reading as json file

not tested yet. would really appreciate feedback.

will close #221.