Build master tables update

Per Ticket #103  this PR reduces the LOC, add docstrings and tests, and improves performance by 50%.