Accounting improvements, fixed serveral bugs, added modal dialog service