Add runtime note generation

Also improved commenting throughtout the project, and renamed several
variables to conform to best practises.