Refactored codebase to share primitives between front end and back end

Depends on #124 

Logically merged frontend and backend value systems.
This is also unrelated. It was just bothering me.