Bucket o'stuff

Added simulation of mouse buttons, moved code around and added new
functions to load layouts based on item clicked in popup menu