Added argument to set popup id. REOL-121
Implemented using the new function in reol_base. REOL-121
Reimplemented a lot of code, to allow prettier errors. REOL-121