reorganize package into modules and add theory directory