Majorly refactored door ram code
Added onDoorRamUsed hook.

Fixes #1678