Major code cleanup and implementation of basic instructions.