Major refactor of lodev. Split up various functions
 into individual files and created header files for each
 .c file with appropriate include guards.