Refactor modules and tests for Browser window UI

@ahal and @chmanchester can you please have a look at this? Lets me know if something looks strange to you.