Merged functionality of all metadataX.php files

- Additional code cleanup