build_db.py: Add a basic algorithm for parsing tables