Simplify getExamples

@tilomitra I used the `pfs` module to replace `fs`, which simplified a couple of functions. Also, I removed the use of `new Promise` in `compile` since it's just a synchronous operation.