Changed API and rewrote plugin, top down.