Refactor metadata table parsing code to prepare for data upload implementation (#466)