The problem is WP is from the bottom-up an exercise in bad coding and this permeates into how plugins and extensions to the cms are developed. It needs an OOP rewrite, restful architecture, MVC patterns etc.