Removed old functions and fixed bugs

- Removed old functions from beginning of script
- Moved dialogs to top of script, which matches other scripts
- Fixed bug which was causing some dates with single-digit-months to show as "M/" instead of "MM" on BILS panel.
- Condensed some old code down with shared functions
- Added many new comments to help explain things better