Finished implementation of attributes. Also fixed some minor bugs and added missing documentation comments.