Added modularization

Put CONSTANS and util functions in their own files