Added reference modules, linked reference input fields, and got rid of unused classes.