Implemented closeApplication(), closes issue #80.