use a hybrid approach for getting POPE

Also fixed some jshint problems while I'm at it.