Tidy up lameparse.

- drop all the global variables we were using. seems like they weren't
  needed
- tidy up body of method so there is a bit less code.