Fix various bugs, add document timing

Fixed bugs includes:
- Update extremes calculation
- Update calculating margin taken by labels
- Part of resource name appearing in the initator field
Apply fixes to the bookmarklet source, update bookmarklet structure
Update build files