Some refactoring

Create and use the following functions:

 1. `_polysquare_forward_options` forwards `cmake_parse_arguments` options and stores them within `RETURN_LIST_NAME`.
 2. `_sort_sources_to_languages` takes a list of `SOURCES`, parses them and stores them in `C_SOURCES` and `CXX_SOURCES`.
 3. `_handle_check_generated_option` removes generated sources if `CHECK_GENERATED` is set.
 4. `_append_to_global_property` appends items in a list to a global property.
 5. `_assert_set` checks that a variable is set and if not aborts with a message
 6. `_add_switch` appends a command line switch to a specified list of options based on an option passed to the function.
 7. `_append_each_to_options_with_prefix` appends each item in a list to a set of options, giving each a prefix.