More refactoring, several bug fixes. Back button issue still persists.