Better custom buttons

Created a parser, so custom functions can use the id of an object.
Implemented a preview custom button.