move all code to an include

This may help speed up things as the includes are precompiled to byte
code only once.