Metabox refactor

Refactors how wordpress metaboxes are created and saved.