Refactored moduleddata.php task and added some tests