massive refactor, separating out the logic from the balpay into compartmentalized modules/directories