Changed the coding style a bit; made the lines shorter, reordered some of the functions so get_one item always comes before get_all_items, and added some documentation.