Fixed another bug in api.window.
Roughed out the basics of the windows_in_direction function.