QUICK NOTES (pun intended):
This song could be analyzed many different ways. What follows is one approach.
Em7 and Bm7 share 2 common tones – extend the Em chord to Em9 and the entire Bm triad is in the Em9 chord (thus 3 common tones).
With the "A" section  of this song toggling quickly between Em7 and Bm7 you get a cool tension and release. This is more interesting than vamping  over a single chord. The melody works fine over a continuous Em chord - but it would have the tendency to drone after a while - nothing interesting is happening for the melody to work against.
In particular, the relationship of these 2 chords is significant. In this song the Em7 chord establishes the tonal center  for our ears. It only takes a moment and we naturally feel like Em is home. Hence all other notes in the melody will want to resolve back to the Note E. This is true for the chords as well. All other chords will want to resolve back to Em.
What makes the Bm7 so interesting is that it creates one of the strongest pulls back to the Em7 chord. There is a chord (B7) that would arguably create a stronger need to resolve but it is not used in this case.
The Bm7 chord acts as a dominant chord  in this context but with an added benefit. The Bm7 chord gives us the need to resolve back to Em but also shares several common tones with the Em7 chord. This allows the rhythm section to have an interesting chordal movement and yet allows the melody to remain very closely related to the Em tonal center.
Analysis of the Main Melody (A Section)
This melody consists of an almost even mix of chord tones and passing tones , with chord tones landing in strategic places to allow for resolve.
The melody has what would be called an anacrusis  - this set of notes is leading us into the melody although arguably it is part of the melody itself upon repeat.
It is a 4 note motif that starts over the Bm7 chord. The notes B E G and A. 2 Chord tones from Bm7 and 2 tones from Em7 that act as passing tones since they are not part of the underlying chord. The passing tones give the melody movement but also set up our ear to reinforce the tonal center of Em. Arguably this 4 note motif, analyzed on its own, could be thought of as an Em11 arpeggio.
Useful Hint: With Bm7 acting in a dominant role in the progression - you can get away with alot of atypical note choices here since we are trying to create tension - not resolve tension. This is true in most cases with the dominant chord (or a chord acting as a dominant chord).
You can get away with alot when playing over the dominant chord since the goal is to create tension - not resolve it.
The next 5 notes of the melody (Bb B Bb A G) have 3 passing tones and 2 chord tones against the Em7 chord. But the coolest part about this is the flat five  (Bb) note. It is also what lends the unusual sound to this melody. It is unexpected - it doesn't belong in the key, it resolves nicely and it makes sense in this context.
If we oversimplified (a severe understatement), one could make the argument that the "Jazz" sound is based around the flat five (b5). The b5 is part of the Jazz vernacular and it resolves nicely to the 5th of the Em chord (the note B). This is exactly what this melody does - and it does it twice in emphasis of the cool "out" sound the b5 creates.
The next 3 notes of this melody (B D E) are all chord tones rounding out the first motif in this melody - giving us a nice resolve within the melody after some cool tension with the b5 note we just heard.
The B and D notes are played against the Bm7 (both chord tones) and the E is played against the Em7.
The next motif in this melody consists of 6 notes (F# G F# E D E). Mostly chord tones with a strong resolve. This harkens back to my previous point that over the dominant chord (in this case Bm7 acting as dominant) you can stretch out a bit with note selection on your way to resolving your phrase. The F# and the D are chord tones within Bm7 and the other tones dance around those chord tones until we resolve to E over Em7.
Identical concept as above but with a different set of notes, D E D B A played over Bm7 - same resolve (E over Em7).
1. Section: Refers to a musical motif within a song and is treated as a single musical idea. (i.e. – Head, Chorus, Intro, etc.)
2. Vamping: A short sequence of chord(s) that gets repeated for an extended period.
3. Tonal Center: The root note or chord of a key.
4. Dominant Chord: A chord with the strongest tension and wants to resolve back to the root chord. Typically the 5th chord in the key.
5. Passing Tones: A non-chord tone found between chord tones.
6. Anacrusis: One or more notes preceding the first bar or phrase.
7. Flat Five: The 5th note in a major key that is flatted one half step.