Adds tests to prove that before and after handlers can be passed as non arrays
Simplify code for building handler chains