move things around and remove ifdefs
remove leading _ from function names, add an example app