Refactor decoration-related code

Split up ModApiMapgen::l_register_decoration()
Define and make use of CONTAINS() and ARRLEN() macros