#589 - Modularize some admin templates, refactor some js