Replaced hack with real solution to get the current window in a controller.
Fixed bug where the contentPane id was incorrectly assigned to the HBox, should be to the AnchorPane.