Add instruction object and more refactoring to prepare for instruction generation