VID-2079 code cleanup, comments, general prep for outside use