Code Cleanup

* Rename AMFocusWindow to am_focusWindow to follow conventions.
* Proper conditional when checking the return value of focusWindow in
	am_focusWindow
* Inline midpoint