Split functions over multiple files

To improve readability and division, install functions and global
functions are now in separate files from the plugin file.