Added better detection of post type and excluded pages. Closes #14.