Plugin and api changes

Stabilized the code all around to handle api function calls and plugins
using the old QLS as a reference. But im not done yet, just need to take
a break. Throwing this commit up now so i dont forget later of what i
did.